Skip to content

Instantly share code, notes, and snippets.

@savelee
Last active July 25, 2016 14:00
Show Gist options
  • Save savelee/711f15026995fe6e1eaf94af78f86ff1 to your computer and use it in GitHub Desktop.
Save savelee/711f15026995fe6e1eaf94af78f86ff1 to your computer and use it in GitHub Desktop.
Arrow Functions: No duplicate named arguments. Arrow functions cannot have duplicate named arguments in strict or nonstrict mode, as opposed to non-arrow functions that cannot have duplicate named arguments only in strict mode
//ES2015
var x = (x,x) => x;
//SyntaxError: duplicate argument names not allowed in this context
//ES5
var x = function (x,x) { return x; }
x("hello", "world"); //returns "world";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment