-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
function add(...values) {
... token used in a parameter list is called rest parameter
var values = Array.prototype.splice.call(arguments, [1])
should be
var values = Array.prototype.slice.call(arguments),
for following reasons:
argumentsobject shouldn't be modified (splice mutates an object, slice doesn't)callexpects a list of arguments, not an array (for arrays there'sapplymethod)addfunction should add every number given in arguments (slice(0)which equate toslice())
Metadata
Metadata
Assignees
Labels
No labels