-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
function push(array, ...items) {
array.push(...items);
}
The code above will throw an SyntaxError
Unexpected keyword 'var'.Expected an opening '{' at the start of a function body.
But if I write rest params separately,they are just fine.
function push(array, ...items) {
array.push.apply(array, items);
}
OR
function push(array) {
var args = [].slice.call(arguments);
array.push.call(...args );
}
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.