Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- removePlayable(idOrPlayable){
- let id = idOrPlayable;
- if (typeof(idOrPlayable) !== 'number'){
- id = idOrPlayable.id;
- }
- console.log(id);
- for (let i = 0; i < this.playlist.length; i++){
- if(this.playlist[i].id === id){
- this.playlist.splice(i,1);
- }
- }
- throw "Error, a playable with the provided id is not contained in the playlist";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement