Creating and filling Arrays of arbitrary lengths in JavaScript

added by JavaScript Kicks
12/23/2018 12:10:23 PM

619 Views

Arrays without holes tend to be faster and more compact, because engines can internally store them contiguously. If you add a hole to an Array, the internal representation has to be switched to a dictionary. In some engines, such as V8, the resulting performance deoptimization is permanent - you can't go back to a contiguous representation.


0 comments