Run details:
Mozilla/5.0 (Linux; Android 10; STK-LX3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Mobile Safari/537.36
Chrome Mobile 94
Android
Mobile
one year ago
Test name Executions per second
RegEx.test 1302001.9 Ops/sec
String.includes 2414302.2 Ops/sec
String.match 740846.9 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");