I'd like to have rules that forbid me from using Array.prototype.shift
and Array.prototype.unshift
because they have truly ridiculous performance characteristics in v8 for some reason, and it's too easy to shoot myself in the foot by using these.
Also I'd imagine a lot of people aren't even aware of this, having rules for this in eslint-plugin-unicorn
could kind of spread the word on this, which I guess would be a positive thing too.
const foo = [];
foo.shift (); // Never use shift
foo.unshift (); // Never use unshift
Everything else basically, it's difficult to enumerate all the much more performant alternatives one might adopt, but general just iterating over the whole array and letting the GC collect it at the end would be much better. Or even reversing the array and pushing/popping values would be so much faster. Basically as long as the array isn't resized from its start performance will be reasonable.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too