JavaScript Negative Indexing Surprise
let a = [0,1,2,3]; a[-2] undefined wait, JS doesnt have negative indexing? never has been
Two astronauts stand on a spacewalk, with one pointing a gun at the other. A JavaScript console shows that accessing an array with a negative index returns “undefined,” while the caption jokes that JavaScript never had negative indexing. The meme is used as a reaction to realizing a supposedly expected programming feature does not exist. EN: Two astronauts stand on a spacewalk, with one pointing a gun at the other. A JavaScript console shows that accessing an array with a negative index returns “undefined,” while the caption jokes that JavaScript never had negative indexing. The meme is used as a reaction to realizing a supposedly expected programming feature does not exist.
- @profunctor_io / 4966 2020-07-19
- Template
- Always Has Been
- Type
- image
- Size
- 800×445 · 54.0 KiB
- Mood
- саркастичный
- Language
- en
- Added