Last active
July 25, 2016 14:00
-
-
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
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
//ES2015 | |
var x = (x,x) => x; | |
//SyntaxError: duplicate argument names not allowed in this context |
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
//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