Test name | Executions per second |
---|---|
RegEx.test | 14028775.0 Ops/sec |
String.includes | 35688172.0 Ops/sec |
String.match | 8449854.0 Ops/sec |
var string = "Hello, world!";
var regex = /[,]/;
regex.test(string);
string.includes("Hello");
string.match("Hello");