Skip to content

Instantly share code, notes, and snippets.

@rosshadden
Created January 28, 2014 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosshadden/8661447 to your computer and use it in GitHub Desktop.
Save rosshadden/8661447 to your computer and use it in GitHub Desktop.
// 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