Better HN
topnewbestaskshowjobs
Log inSign up

qwermike

2 karma · joined Feb 3, 2018 (8y ago) · 8 submissions

Submissions

comment 8y ago · link · parent

I've just been in this place before

comment 8y ago · link · parent

Probably, you can optimize .forEach even more. You can get 'arr.length' and 'let i = 0' outside of the for-loop.

It could be faster according to this test: https://jsperf.com/extended-array-loops-performance