I know one has to be very careful with the function Arguments object
But are there any known downsides (optimization/performance issues) to using the spread syntax with the Arguments object? Or is this totally okay?
I want to create an array from an unknown amount of arguments passed to a function:
function Numbers(){
this.numbers = [...arguments];
}
It looks quite neat, and in the MDN page about the Arguments object is even suggested that I can use spread syntax for this:
As you can do with any Array-like object, you can use ES2015's
Array.from()method or spread syntax to convertargumentsto a real Array
But I still would like see if others have another opinion on this.