20.
How can you combine the following arrays using the spread operator?
const arr1 = [1, 2, 3];
const arr2 = [...arr1, 4, 5, 6];
const arr3 = [7, 8, 9];
const combinedArray = [...arr2, ...arr3];
const combinedArray = [...arr2, arr3];
const combinedArray = [arr2, ...arr3];
const combinedArray = [...arr2, 7, 8, 9];
Correct: A
The spread operator (...) allows you to expand arrays into individual elements. In this case, we can use the spread operator to combine arr2 and arr3 into a new array. This results in a new array [1, 2, 3, 4, 5, 6, 7, 8, 9].