🔰spread operator (...)
[...iterable], {...obj}, f(...iterable).
JS ⟩ statement ⟩ expression ⟩ operator ⟩ spread
adds all enumerable own properties of an object to an object literal.
⚠️ spread operator (...) is not a true operator, it cannot be evaluated to produce a value❗ (👉 table of operators)
...obj only spreads enumerable own properties, 👉 property enumeration.
can be used to assign default values instead of using Object.assign().
spread operator (...)
can be used in an array literal.
"spreads out" an iterable into array elements or function arguments.
ℹ️ punctuators used: 3 dots (...)
Last updated