Solution: Make a List, Check It Twice
Displays each song from a list in the console one by one.
Explanation:
An array named
songsstores three song titles.The
forloop goes through each item in the array usingias an index.console.log("Song:", songs[i]);prints each song name with the label “Song:”.The loop runs three times — once for each song in the list.
Solution: Make a List, Check It Twice
Displays each song from a list in the console one by one.
Explanation:
An array named
songsstores three song titles.The
forloop goes through each item in the array usingias an index.console.log("Song:", songs[i]);prints each song name with the label “Song:”.The loop runs three times — once for each song in the list.