Files
bun.sh/bench/snippets/array-arguments-slice.mjs
Michael H b54137174b Bench updates (#15029)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-11-08 23:15:24 -08:00

13 lines
268 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();