DEV Community

Prasham Ashesh
Prasham Ashesh

Posted on

1

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

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay