DEV Community

Prasham Ashesh
Prasham Ashesh

Posted on

Weird Javascript?

const a = [1]
a[3] = 3
console.log(a.length);

//What do you expect the output to be?

Top comments (1)

Collapse
 
pracoon profile image
Prasham Ashesh

Answer: 4