why does tempArr here give the same value as the one inside the original array
let arr = [[1,2,3,4,5], [6,7,8,9,0]]
let tempArr = arr[0]
arr[0].push(6)
// tempArr.pop()
console.log("arr",arr )
console.log("tempArr",tempArr )
Output:
arr [ [ 1, 2, 3, 4, 5, 6 ], [ 6, 7, 8, 9, 0 ] ]
tempArr [ 1, 2, 3, 4, 5, 6 ]