I’ll never new Array(length) again. Holy holey @mathias , although the fact typed Arrays want length upfront can be confusing! #NodeConfAr17
-
-
I like using this pattern to create x objects: Array(10).fill(0).map(…) I assume the perf hit doesn’t really apply here since I map it?
-
Indeed — it creates a holey array but `map` creates a new one that is packed. Btw, `new Array(n)` is faster than `Array(10)` in
@v8js. - 1 more reply
New conversation -
-
-
Cool stuff. Never would've thought of that.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.
