Created
September 23, 2015 21:16
-
-
Save jasonbellamy/852356d529a59b0f7346 to your computer and use it in GitHub Desktop.
Arguments is an "array like" object so you cannot directly iterate over it.
This file contains hidden or 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
var square = function () { | |
return arguments.map(function(arg) { | |
return arg * arg; | |
}); | |
}; | |
square(1, 2, 3, 4, 5); // => "TypeError: arguments.map is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment