Create a generator function called getStop
which yields different stops on the train line from Poughkeepsie to Grand Central Station.
The stops are as follows:
- Poughkeepsie
- Newburgh
- Peekskill
- Yonkers
- Bronx
- Grand Central
You will have a button with an id of next-stop
that, when clicked, will console log the next stop or if the end of the line has been reached will console log "We made it!"
- Use a generator function
Poughkeepsie
Newburgh
Peekskill
Yonkers
Bronx
Grand Central
We made it!