Skip to content

Instantly share code, notes, and snippets.

@steveharoz
Created June 8, 2016 04:36
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 steveharoz/837317e07f2af5f950775b05b9b3d374 to your computer and use it in GitHub Desktop.
Save steveharoz/837317e07f2af5f950775b05b9b3d374 to your computer and use it in GitHub Desktop.
Weird context sensitivity in javascript es6
a = {number: 1}; // works
a = [1, 2, 3].map( n => 1 ); // works
a = [1, 2, 3].map( n => {number: 1} ); // unexpected ':'
a = [1, 2, 3].map( n => {return {number: 1};} ); // works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment