Test name | Executions per second |
---|---|
Spread first then map | 23.2 Ops/sec |
Map first then Array.from | 12.5 Ops/sec |
<!--your preparation HTML code goes here-->
let foo = new Map();
for (let i = 0; i < 1_000_000; i++) {
foo.set(i, i % 8);
}
[foo.entries()].map(([i, iMod8]) => [i, iMod8.toString()])
Array.from(foo.entries().map(([i, iMod8]) => [i, iMod8.toString()]))