Q. What will the output be?
Code:let x = [1, 2, 3]; let y = x; y.push(4); console.log(x);
β
Correct Answer: (B)
[1, 2, 3, 4]
Explanation: Arrays are reference types, so modifying y also affects x.