Question: Given the following JavaScript code, what will be the output after the modifications (ha 3) *?are made let originalArray = [10, 20, [30, 40]];
Given the following JavaScript code, what will be the output after the modifications (ha 3) *?are made let originalArray = [10, 20, [30, 40]]; let copiedArray = [...originalArray]; copiedArray[0] = 100; copiedArray[2].push(50); console.log(originalArray); console.log(copiedArray);
Step by Step Solution
3.51 Rating (144 Votes )
There are 3 Steps involved in it
After the modifications are made to the code the output will be as follows let o... View full answer
Get step-by-step solutions from verified subject matter experts
