File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ var people = [
20
20
// person in the `people` array. Assign the returned array to a variable
21
21
// called `peopleNames`.
22
22
// Type your solution immediately below this line:
23
-
23
+ var peopleNames = people . map ( person => ( person . name ) )
24
24
25
25
26
26
// #2: Use the `filter` array method to create a new, filtered array containing only
Original file line number Diff line number Diff line change 5
5
// - a `songs` property that is an empty array not determined by input (not passed into the constructor)
6
6
// - an `addSong` method that adds a song (string) to the `songs` array
7
7
// 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
+ }
12
17
13
18
// #2: Create an instance of the Playlist class and set it to a variable called `myPlaylist`
14
19
// Call the instance's `addSong` method to add a song to the instance's `songs` array
You can’t perform that action at this time.
0 commit comments