functionpush(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.
functionpush(array, ...items){array.push.apply(array,items);}OR
functionpush(array){varargs=[].slice.call(arguments);array.push.call(...args);}
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.
OR