Search

Benchmark created on


Setup

const searchName = "Enter-678";

const names = [
  { role: "None", name: "Enter-012" },
  { role: "User", name: "Enter-345" },
  { role: "Admin", name: "Enter-678" },
  { role: "Boss", name: "Enter-900" } 
];

Test runner

Ready to run.

Testing in
TestOps/sec
Filter
const found = names.filter(({ name }) => name === searchName);

console.log(found.length > 0);
ready
map + includes
const flatNames = names.map(({ name }) => name);

console.log(flatNames.includes(searchName));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.