Share
Explore BrainMass

Java Script program: Song, Publishing Year

Create a JavaScript program that declares and prints an array that includes at least 20 of your favorite songs. For each song, determine the best means for storing the year it was published. Using JavaScript, print each song's name along with the year it was published. The print logic must use a loop. The song data really do not matter; the programming does.

Solution Preview

You can load attached 536802.html in any browser where you have Javascript enabled.

Attached Javascript solution is one of the many ways in which the goal can be achieved. It uses an array of arrays for storing the songs and the corresponding years when the respective songs were published. Each element of the songs array is an array of two elements with first element being the song name and second element being the year it was published in.

Please edit and populate the songs array with as many entries as you want. Solution has few sample entries for demonstrating as to how the songs information should be stored.

Instead of using an array of arrays, we could ...

Solution Summary

Solution uses an array of arrays for storing the songs and the corresponding years when the respective songs were published, but it also discusses two more approaches to store songs data.

$2.19