All Stations Map

Home

Dataset Information

For this exercise, we will use data about train stations from the Metro North and Shore Line East rail systems in New York and Connecticut.

Part 1

Write JavaScript code to process the provided trainStations variable to answer the questions below. Log each of the answers to the console.

  1. Display the number of stations (i.e. 17).
  2. Loop through the train stations and display the name and abbreviation of each.


Part 2

Write JavaScript code to process the provided trainStations variable to answer the questions below. Display the answers on the page in the designated places.

  1. Loop through the stations and display a marker for each station on the map. The marker text should include the name of the station. Optionally also include a hyperlink to the webpage providing more information about that station.


Map