Files
bun.sh/bench/snippets/array-arguments-slice.mjs
2022-11-02 20:46:24 -07:00

13 lines
261 B
JavaScript

import { bench, run } from "mitata";
function doIt(...args) {
// we use .at() to prevent constant folding optimizations
return args.slice().at(0);
}
bench("Array.prototype.slice.call(arguments)", () => {
return doIt(1, 2, 3, 4, 5, 6);
});
await run();