loading...

re: 2 Ways to Merge Arrays in JavaScript VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Surprisingly concat is way faster. Doing any type of spread is 91% slower. jsperf.com/concat-vs-spreader/1 Edit: Actually, it seems to depend on t...
 

Interesting, thanks for writing out the test! Good to keep in mind if you need to optimize the code. But I wonder as spread become more popular, if the browser will start optimizing it ... maybe concat is faster because it’s been around longer and the browser is deciphering it πŸ€”

 

I wondered that too. You would think it would just call concat internally. I'm not sure what would cause the huge difference.

code of conduct - report abuse