Skip to content

Commit 03eba47

Browse files
Update Add Song
Fixed test suvelocity#7 return id
1 parent 3a4138a commit 03eba47

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

index.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ const player = {
7272
// ===> Returns the song by the ID given <===
7373
fingObjectByID(id){
7474
return player.songs.find(songObj => songObj.id === id);
75+
},
76+
77+
// ===> Returns the playlist by the ID given <===
78+
fingObjectPlaylistByID(id){
79+
return player.playlists.find(songObj => songObj.id === id);
7580
}
7681
}
7782

@@ -143,16 +148,20 @@ function addSong(title, album, artist, duration, id) {
143148
}
144149

145150
player.songs.push({
146-
"title": title,
147-
"album": album,
148-
"duration": newDuration,
149-
"artist": artist,
150-
"id": id
151+
title: title,
152+
album: album,
153+
duration: newDuration,
154+
artist: artist,
155+
id: id
151156
});
157+
158+
// Return ID
159+
return id;
152160
}
153161

162+
154163
function removePlaylist(id) {
155-
// your code here
164+
156165
}
157166

158167
function createPlaylist(name, id) {

0 commit comments

Comments
 (0)