by zodiakzz · 5y ago · 0 comments
...also, from a reasoning approach - why would a competitively accelerated language engine create an array full of holes as soon as one is declared? Why would the engine not try to optimally structure the type as it is used? This is something Chromes engines and Firefoxes appear to have done, quite impressively since many years back.
Array(n).fill()
is a permanent deoptimization? And if so, is the new array returned by: Array(n).fill().map(x => x)
better optimized (after the, presumably, suboptimal iteration)?