Created
January 28, 2014 02:42
-
-
Save rosshadden/8661447 to your computer and use it in GitHub Desktop.
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
// A: This is valid JS: | |
var foobar = { | |
foo: function bar() { | |
// pass | |
} | |
}; | |
// B: This is valid ES6 | |
let foobar = { | |
foo() { | |
// pass | |
} | |
}; | |
// C: This is also valid ES6 | |
let foobar = { | |
foo: () => { | |
// pass | |
} | |
}; | |
// D: This is NOT valid ES6 (at least according to Traceur) | |
let foobar = { | |
foo: bar() { | |
// pass | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment