DEV Community

Interesting tip On JavaScript

Ava Millar on May 26, 2023

Here's an interesting tip for JavaScript: Consider using the spread syntax (...) in combination with array literals ([]) to manipulate arrays in a...
Collapse
 
jd2r profile image
DR

Nice post! :)

I've been told before that using concat to concatenate arrays is a bit slower than spreading and dumping. It's a good example as to the use of the spread operator though.

I noticed that your code blocks weren't displaying correctly - to format correctly, just use three backticks at the beginning and end of the code block.