I may be missing something very simple here. I am trying to use splice to add 0 onto the front of this array. However, the result of both console logs are [0,1,2,3,4,5]. It’s like it is retroactively adding the zero to the first console log. I try this exact code on other javascript editors and it works as intended. Any help would be great.
function setup() {
let A = [1,2,3,4,5]
console.log(A)
A.splice(0,0,0)
console.log(A)
}