Last active
July 25, 2016 13:59
-
-
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.
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 foo = (x,y) => arguments[0]; | |
foo("lee","2") //ReferenceError: arguments is not defined [Learn More] |
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 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