restspread
restspread is a JavaScript feature introduced in ECMAScript 2018 that allows you to expand an iterable (like an array) or an object into its individual elements or properties. It serves two primary purposes: the rest parameter and the spread syntax.
The rest parameter, used in function declarations, collects an indefinite number of arguments into a single
The spread syntax, on the other hand, is used in contexts where multiple elements or properties are
When applied to objects, the spread syntax allows you to copy the enumerable own properties of an