Better HN
topnewbestaskshowjobs
Log inSign up

fcukhn

-3 karma · joined Apr 23, 2015 (11y ago) · 1 submissions

Submissions

comment 11y ago · link · parent

Actually this code is very stupid and you're half correct. The standard built in Array methods like map or forEach don't work on implicitly defined undefined values but on explicit one they do.

For example: [1,2,3,undefined].forEach(ele => console.log(ele)) > 1 > 2 > 3 > undefined On the other hand: [1,2,3,,].forEach(ele => console.log(ele)) > 1 > 2 > 3

So, take the time you dedicate to hating JavaScript to understand the language instead of bitching here you and that stupid jerk above.