JavaScript spread syntax and spread operator
In JavaScript, the […array] syntax is known as the “spread syntax” or “spread operator.” It is used to create a shallow copy of an array (or any iterable object) or to merge arrays. This syntax was introduced in ECMAScript 6 (ES6) to provide a concise way to work with arrays and iterables. Here’s a breakdown…