aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/index-of.mjs
blob: 04b9704e96170c0fdbfda2681eea46392be1883d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { bench, run } from "./runner.mjs";

const input =
  "Hello, World! foo bar baz qux quux corge grault garply waldo fred plugh xyzzy thud z a b c d e f g h i j k l m n o p q r s t u v w x y z".split(
    " ",
  );

bench(`Array.indexOf`, () => {
  return input.indexOf("thud");
});

await run();