Skip to content

Instantly share code, notes, and snippets.

@savelee
Last active July 25, 2016 13:59
Show Gist options
  • Save savelee/b50ba2e62b16b0f0dbe5c3dd6734f19c to your computer and use it in GitHub Desktop.
Save savelee/b50ba2e62b16b0f0dbe5c3dd6734f19c to your computer and use it in GitHub Desktop.
Arrow Functions: No arguments object, since arrow functions have no arguments binding, you must rely on named and rest parameters to access function arguments.
//ES2015
var foo = (x,y) => arguments[0];
foo("lee","2") //ReferenceError: arguments is not defined [Learn More]
//ES5
var foo = function (x,y) { return arguments[0]; }
foo("lee", "2"); //returns "lee";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment