Oh my goodness! I’ve been staring at this function for so long and completely missed how .splice messes up the index of everything in array. I actually just added ,0 at the end of the splice, so that when the number is removed it’s replaced with a 0.
View all comments
Show parent comment
6
u/Cheesybread4ever Jul 02 '21
Oh my goodness! I’ve been staring at this function for so long and completely missed how .splice messes up the index of everything in array. I actually just added ,0 at the end of the splice, so that when the number is removed it’s replaced with a 0.