-1

const arr1 = [[1]]
const arr2 = arr1[0]
const temp = arr1.pop()
console.log(arr2)
temp.pop() // change happens here
console.log(arr2)

Going a little crazy... why is arr2 being changed at the point I commented?

0 Answers0