Javascript Interview Question: Why Does [1,2,3,4,5][1,2] = 2?

2025 1:05
Synopsis
The JavaScript expression [1,2,3,4,5][1,2] results in 2 due to how JavaScript handles array access and comma expressions.
Download Options
Choose a download method below. All links open in new tabs.
Service Features Action
SaveFrom
MP4 & MP3 • HD Quality • Browser Extension Available
Download
Security Notice: These are third-party services. We recommend using antivirus software and being cautious of pop-up ads.