there was actually an article recently that touched on the subject mentioned by Serhii Sakal dev.to/_codingblocks/when-is-an-ar...
I was wondering, why not just use an object instead of an array?
let's take a simple example, where you have something like this
consta=[1,2];a[1000]=1000;console.log(a);
and look at the size of a.
even with your example, the created lookup array is bigger than the given array, so you're using more memory than needed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
there was actually an article recently that touched on the subject mentioned by Serhii Sakal dev.to/_codingblocks/when-is-an-ar...
I was wondering, why not just use an object instead of an array?
let's take a simple example, where you have something like this
and look at the size of a.
even with your example, the created lookup array is bigger than the given array, so you're using more memory than needed.