Tell us what’s happening:
I did it okay with .push() but I was wondering how to do it without .push().
arr[arr.length + 1] = item
But when the array is empty, obviously, it becomes the index 1 not zero, so the array is [undefined, item].
I supose I’d use a simple if.
(arr.length > 0) ? arr[arr.length] = item : arr. = item
But I think it lacks of sense.
Just out of curiosity.