test with ignore case vs indexOf with equality test (v116)

Revision 116 of this benchmark created by Tom Guy on


Description

Using test with ignore case flag set for string search compared to indexOf. Use greater than with indexOf to return true or false.

Preparation HTML

<script>
  var str = "hello world!";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
regexp-search
/world/i.test(str);
ready
indexOf with greater than test
str.indexOf("world")>-1;
ready

Revisions

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