Created
May 18, 2015 17:32
-
-
Save duvillierA/8db3f37f06b4ed825856 to your computer and use it in GitHub Desktop.
Es6 Features
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
import _ from 'lodash'; | |
'use strict'; | |
export class Hello { | |
constructor(name="John") { | |
this.name = name; | |
} | |
set name(name) { | |
this._name = name; | |
} | |
get name() { | |
return this._name; | |
} | |
hello() { | |
// Multiline strings and Interpolate variable bindings | |
return `Hello | |
${this.name}!`; | |
} | |
static sayHelloAll() { | |
return 'Hello everyone!'; | |
} | |
} | |
export class HelloWorld extends Hello { | |
constructor(...rest) { | |
super(...rest); | |
} | |
echo() { | |
console.log(super.hello()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment