Created
March 28, 2015 00:02
-
-
Save keokilee/66217737857073238cc5 to your computer and use it in GitHub Desktop.
ES6 Enhanced Object Literals
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
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