What is "undefined x 1" in JavaScript?

JavascriptFront End TechnologyObject Oriented Programming

This is not a feature of JavaScript but is Chrome's way of displaying uninitialized indexes in arrays (and array-like objects). For example, if you console.log the following −

Example

console.log(Array(100))

Output

[undefined × 100]

This is better than printing [undefined, undefined, undefined,...] as it is more readable.

raja
Published on 16-Sep-2019 11:33:51
Advertisements