DEV Community

Discussion on: Javascript Array.push is 945x faster than Array.concat 🤯🤔

Collapse
 
eavichay profile image
Avichay Eyal

You got it wrong in the benchmark.
Pushing an array is 1 item change on the array.
Pushing [...arr] is different. not x1K faster.

Collapse
 
shiling profile image
Shi Ling

I'm sorry, not quite sure what you mean. Could you explain which part you are referring to and why it's incorrect?

Collapse
 
geompse profile image
Geompse

It is not obvious that :
.bind(objthis)(arg1,arg2) == .call(objthis,arg1,arg2) == .apply(objthis,[arg1,arg2])

Also, Array.push accepts multiples values : myarray.push(value1,value2,value3)