Successfully added
Snipps
by Patrik
JS Spread Syntax (...)
The spread (...) syntax allows an iterable, such as an array or string, to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected.
Spread operator doing concat
let arrayOne = [1, 2, 3];
let arraryTwo = [4, 5];
arrayCombined = [...arrayOne,...arrayTwo];
Add item using spread operator
let arrayOne = [1, 2, 3];
arrayNew = [...arrayOne, 3];
Referenced in:
Comments