portal-stuff

Benchmark created on


Setup

var list = ["name", "OTHER NAME", "ROUTE NAME"];

Test runner

Ready to run.

Testing in
TestOps/sec
indexof
var toFind = "OTHER NAME";

if (list.indexOf(toFind) !== -1) return true;
ready
for loop
var toFind = "OTHER NAME";
var found = false;

for (var i in list) {
    if (list[i] == toFind) {
         found = true;
    }
}
ready

Revisions

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