forked from Carnavos/musichistory-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsongs.js
37 lines (29 loc) · 1.13 KB
/
songs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use script"
let songs = [];
songs[songs.length] = "Legs > by Z*ZTop on the album Eliminator";
songs[songs.length] = "The Logical Song > by Supertr@amp on the album Breakfast in America";
songs[songs.length] = "Another Brick in the Wall > by Pink Floyd on the album The Wall";
songs[songs.length] = "Welco(me to the Jungle > by Guns & Roses on the album Appetite for Destruction";
songs[songs.length] = "Ironi!c > by Alanis Moris*ette on the album Jagged Little Pill";
// adding a song to beginning of array
songs.unshift("Crazy by Javier")
// adding a song to end of array
songs.push("Without You by Usher")
// loop over array and remove any words or characters that obviously don't belong
function songCycle(){
for (let i = 0; i < songs.length; i++) {
songs[i] = songs[i].replace("*","");
songs[i] = songs[i].replace(">", "-");
songs[i] = songs[i].replace("@", "");
songs[i] = songs[i].replace("(", "");
songs[i] = songs[i].replace("!", "");
}
songPlace()
};
function songPlace(){
let songtoDom = document.getElementById("Names");
for(i =0; i < songs.length; i++){
songtoDom.innerHTML += `<p>${songs[i]}</p>`;
}
};
songCycle()