Above output show, the first two consecutive "undefined" that are represented by *2, to show that there are two consecutive undefined there. Although, if there is only one undefined value, they could drop the x 1. Thus, it's clear that the Chrome browser has its own way of displaying uninitialized indexes in arrays.
A sparse array is one in which the elements do not have contiguous indexes starting at 0. Normally, the length property of an array specifies the number of elements in the array. If the array is sparse, the value of the length property is greater than the number of elements. When array is sufficiently sparse (missing lots indexes), it loses its special efficiency when accessing array by indexes. In performance , it effectively is like a hashtable.
- What is noscript tag?
- Difference between '=', '==' and '===' operators?
- What is Browser Object Model
- How to test a string as a literal and as an object ?
- What is Associative Array? How do we use it?
- What's the Difference Between Class and Prototypal Inheritance?
- Event bubbling and Event Capturing in JavScript?