Skip to content

Instantly share code, notes, and snippets.

@keokilee
Created March 28, 2015 00:02
Show Gist options
  • Save keokilee/66217737857073238cc5 to your computer and use it in GitHub Desktop.
Save keokilee/66217737857073238cc5 to your computer and use it in GitHub Desktop.
ES6 Enhanced Object Literals
var name = "George";
var objES5 = {
name: name,
greeting: function() {
return "Hello " + this.name;
}
};
var objES6 = {
name,
greeting() {
return `Hello ${this.name}`;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment