What is the spread operator?
Used to expand arrays or objects into individual elements.
Example:
const arr = [1, 2, 3];
const newArr = [...arr, 4, 5]; // [1, 2, 3, 4, 5]
Used to expand arrays or objects into individual elements.
Example:
const arr = [1, 2, 3];
const newArr = [...arr, 4, 5]; // [1, 2, 3, 4, 5]