Skip to content

Instantly share code, notes, and snippets.

@duvillierA
Created May 18, 2015 17:32
Show Gist options
  • Save duvillierA/8db3f37f06b4ed825856 to your computer and use it in GitHub Desktop.
Save duvillierA/8db3f37f06b4ed825856 to your computer and use it in GitHub Desktop.
Es6 Features
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