Was writing a function that takes in an array of numbers and returns true and the index if there is a missing number or false if there are no missing numbers. I Just noticed something about arrays that confuses me.
An array like
[,1,2,3,4]
will print
[undefined,1,2,3,4]
The array starts with a comma, Output makes sense to me
But why does
[1,2,3,4,] // Notice that the array ends with a comma
[1,2,3,4]
I would have assumed the output would be [1,2,3,4,undefined].
Does anyone know why this is so?