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