Test case name | Result |
---|---|
text.includes() | |
regex.test() | |
string.match() | |
string.indexOf() | |
string.indexOf() !== -1 | |
string.indexOf() != -1 |
Test name | Executions per second |
---|---|
text.includes() | 10255340.0 Ops/sec |
regex.test() | 6247741.0 Ops/sec |
string.match() | 5213705.0 Ops/sec |
string.indexOf() | 10285840.0 Ops/sec |
string.indexOf() !== -1 | 10343000.0 Ops/sec |
string.indexOf() != -1 | 10395950.0 Ops/sec |