Skip to content

Commit 3eb8f30

Browse files
committed
1 parent c045d6a commit 3eb8f30

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

hof.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var people = [
2020
// person in the `people` array. Assign the returned array to a variable
2121
// called `peopleNames`.
2222
// Type your solution immediately below this line:
23-
23+
var peopleNames = people.map(person => (person.name))
2424

2525

2626
// #2: Use the `filter` array method to create a new, filtered array containing only

oojs.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
// - a `songs` property that is an empty array not determined by input (not passed into the constructor)
66
// - an `addSong` method that adds a song (string) to the `songs` array
77
// Type your solution immediately below this line:
8-
9-
10-
11-
8+
class Playlist {
9+
constructor (title){
10+
this.title = title
11+
this.songs = []
12+
}
13+
}
14+
addSong(newSong){
15+
this.songs.push(newSong)
16+
}
1217

1318
// #2: Create an instance of the Playlist class and set it to a variable called `myPlaylist`
1419
// Call the instance's `addSong` method to add a song to the instance's `songs` array

0 commit comments

Comments
 (0)