/gist:7f2d61362ea0d4484135 Secret
Created
June 15, 2015 09:05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Media { | |
constructor(title, duration, isPlaying = false) { | |
this.title = title; | |
this.duration = duration; | |
this.isPlaying = isPlaying; | |
} | |
start() { | |
this.isPlaying = true; | |
} | |
stop() { | |
this.isPlaying = false; | |
} | |
} | |
class Song extends Media { | |
constructor(title, artist, duration, isPlaying = false) { | |
super(title, duration, isPlaying); | |
this.artist = artist; | |
} | |
toString() { | |
return `<li> | |
${this.title} - ${this.artist} <span>${this.duration}</span> | |
</li>`; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment