Skip to content

Conversation

@AvivYamin
Copy link

No description provided.

…reverse) I created an id check function. I edited the playSong method and created a playSong function that uses all the above.
…array by its ID. I created a function that deletes a song from the playlists array by its Id. I merged these function into a function that is called removeSong which deletes a song by its ID both from the songs and playlist arrays.
…eceives parameters as the task asked and activated the randomId generator in case that the id argument was missing. My function creates an object of the arguments received and pushes it to the songs array. I also tried the constructor method for fun.
…e playlist if it exists and false if not. I edited the remove playlist to use checkPlaylistId and omits the wanted playlist from playlists.
…taken it returns -1 and if not it returns the id. I edited the createPlaylist function to generate a playlist object with a unique ID.
… if it does, the checkPlaylistID returns the playlist of that id and playPlaylist plays it songs, if it's not existent it throws an error.
…turns the boolean result. in the editPlaylist function I threw 2 Errors if the song is not in the player or the playlist does not exists, both by id. if the song does not exists in the playlist the function pushes it to the songs list of that playlist, if it does the function omits the song from the songs list of that playlist. if the specific song was the only song in the songs list the function deletes the entire playlist.
…he player. I made the function playlistDuration to check the validity of the playlist's ID and if it's valid to return the sum of all the durations of the songs in the songs list that's in the playlists array.
…the value it receives. I mad 2 functions that use the matchCheck to push the matching songs and playlists to a new arrays and sorts them alphanumerically. The main function uses all of the above to create an object with the resulted arrays.
…e between the song duration and the wanted duration. I created a function that receives a durations array and returns the duration with the smallest difference. I created 2 functions that receives a song/playlist duration and returns the song/playlist. The main function uses all above and determents which song/playlist is the closest to the given duration and returns it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant