Files
bun.sh/bench/snippets/array-arguments-slice.mjs
2023-05-10 21:37:08 -07:00

13 lines
267 B
JavaScript

import { bench, run } from "./runner.mjs";
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();