Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algorithmic Trading Navigating The Digital Frontier

Authors: Alex Thompson

1st Edition

B0CHXR6CXX, 979-8223284987

More Books

Students also viewed these Databases questions

Question

What is meant by the term clarity as it relates to leading others?

Answered: 1 week ago