Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Firefox 108
Windows
Desktop
2 years ago
Test name Executions per second
RegEx.test 29250990.0 Ops/sec
String.includes 47097156.0 Ops/sec
String.match 13645029.0 Ops/sec
Script Preparation code:
AخA
 
var string = "Hello world!";
var regex = /Hello/;
Tests:
  • RegEx.test

     
    regex.test(string);
  • String.includes

     
    string.includes("Hello");
  • String.match

     
    string.match("Hello");