Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ToshihiroGoto
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToshihiroGoto/0ffaf0faf38ed1633815 to your computer and use it in GitHub Desktop.
Save ToshihiroGoto/0ffaf0faf38ed1633815 to your computer and use it in GitHub Desktop.
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