Skip to content

Instantly share code, notes, and snippets.

@jasonbellamy
Created September 23, 2015 21:16
Show Gist options
  • Save jasonbellamy/852356d529a59b0f7346 to your computer and use it in GitHub Desktop.
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.
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