Arrays

Sparse array hole

Try the free JavaScript compiler

A hole is an absent indexed own property. Reading it typically yields undefined, but methods differ in whether they skip absent positions or read them. Inherited indexed properties can affect the result.

Formal Syntax & Structure

javascript syntaxjavascript
[1, , 3]

Working Example

Example Snippetjavascript
const a=[1,,3];console.log(a.length,1 in a,a[1]);
JavaScript Reference