Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. removePlayable(idOrPlayable){
  2. let id = idOrPlayable;
  3. if (typeof(idOrPlayable) !== 'number'){
  4. id = idOrPlayable.id;
  5. }
  6. console.log(id);
  7. for (let i = 0; i < this.playlist.length; i++){
  8. if(this.playlist[i].id === id){
  9. this.playlist.splice(i,1);
  10. }
  11. }
  12. throw "Error, a playable with the provided id is not contained in the playlist";
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement