Last active
August 29, 2015 14:26
-
-
Save ToshihiroGoto/0ffaf0faf38ed1633815 to your computer and use it in GitHub Desktop.
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 Message{ | |
constructor(name) { | |
this.name = name | |
} | |
say(serif) { | |
if(!serif) serif = ""; | |
console.log( this.name + ': World!' + serif); | |
} | |
} | |
class Loud extends Message{ | |
constructor(name) { | |
super( name ) | |
} | |
loud() { | |
this.say("!!!!!!!!!!!!!!!!!") | |
} | |
} | |
var l = new Loud("Hello!"); | |
l.loud(); // Hello!: World!!!!!!!!!!!!!!!!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment