Question
Lab 2 | COMP1073 Client-Side JavaScript Airports Beijing Capital International, https://goo.gl/maps/iPe5fAqzq8C2 PEK John F Kennedy International, https://goo.gl/maps/JWwABmA3MBS2 JFK Lester B. Pearson International, https://goo.gl/maps/Ypu1dJLsnQu YYZ London
Airports
- Beijing Capital International, https://goo.gl/maps/iPe5fAqzq8C2 PEK
- John F Kennedy International, https://goo.gl/maps/JWwABmA3MBS2 JFK
- Lester B. Pearson International, https://goo.gl/maps/Ypu1dJLsnQu YYZ
- London Heathrow, https://goo.gl/maps/TFx8SrATdYr LHR
- Tokyo Haneda International, https://goo.gl/maps/5UxH2TxbRtT2 HND
Need help with.
Build upon the provided JavaScript, and do the following things inside the loop as directed by the code comments: 1. Find the character index of the comma 2. Obtain the full name of the airport using the comma character index number as a reference point, and store it in a new variable 3. Capture the international airport code at the end of the string, and store it as a variable 4. Get the Google Maps short URL from the string, using the character index number of the comma, and store it as a variable 5. Build a new string that is a hyperlink, using the Google Maps URL as the href and set it as the value of the result variable 6. BONUS Output the average number of characters of the airport names inside a paragraph after the list of airports
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started