&& vs includes

Benchmark created on


Description

Test created by @Logos

Setup

const name = "vlad"

Test runner

Ready to run.

Testing in
TestOps/sec
&& x30
if (name !== "anna" && name !== "alex" && name !== "oliver" && name !== "jack" && name !== "harry" && name !== "jacob" && name !== "charley" && name !== "thomas" && name !== "george" && name !== "oscar" && name !== "anna" && name !== "alex" && name !== "oliver" && name !== "jack" && name !== "harry" && name !== "jacob" && name !== "charley" && name !== "thomas" && name !== "george" && name !== "oscar" && name !== "anna" && name !== "alex" && name !== "oliver" && name !== "jack" && name !== "harry" && name !== "jacob" && name !== "charley" && name !== "thomas" && name !== "george" && name !== "oscar") {
  console.log(name)
}
ready
includes x30
if (!["anna", "alex","oliver","jack","harry","jacob","charley","thomas","george","oscar","anna", "alex","oliver","jack","harry","jacob","charley","thomas","george","oscar","anna", "alex","oliver","jack","harry","jacob","charley","thomas","george","oscar"].includes(name)) {
  console.log(name)
}
ready

Revisions

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