Test case name | Result |
---|---|
regexp .test() | |
string .match() | |
indexOf === 0 | |
string .startsWith() | |
regexp .test() failure | |
string .match() failure | |
indexOf === 0 failure | |
string .startsWith() failure |
Test name | Executions per second |
---|---|
regexp .test() | 17450190.0 Ops/sec |
string .match() | 14155650.0 Ops/sec |
indexOf === 0 | 26731630.0 Ops/sec |
string .startsWith() | 19714600.0 Ops/sec |
regexp .test() failure | 17556490.0 Ops/sec |
string .match() failure | 14471780.0 Ops/sec |
indexOf === 0 failure | 26399540.0 Ops/sec |
string .startsWith() failure | 19662740.0 Ops/sec |