indexOf-vs-iter

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
var sentence = "the quick brown fox jumps over the lazy dog";

var tmp = sentence.lastIndexOf(" ");
ready
iterative
var sentence = "the quick brown fox jumps over the lazy dog";

for (var i = 0; i < sentence.length; i++) {
 if (sentence.charAt(i) == " ") tmp = sentence.charAt(i);
}
ready

Revisions

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