In this particular query, I discovered that the issue was due to mistakenly incrementing the Array.Prototype.length
property using ++
My curiosity lies in why length
is not a read-only property of Arrays. Despite it not being an oversight in the language's design, as stated on MDN where it mentions being able to "SET or return" the length of an array. What puzzles me is why one can make such mistakes? What scenario would justify altering the length of an array without modifying the number of elements it holds?