text.includes() vs regex.test() vs string.match() vs string.indexOf()| Test case name | Result |
|---|---|
| text.includes() | |
| regex.test() | |
| string.match() | |
| string.indexOf() |
| Test name | Executions per second |
|---|---|
| ✓ string.indexOf() | 13,833,514 Ops/sec |
| text.includes() | 13,770,596 Ops/sec |
| regex.test() | 8,742,252 Ops/sec |
| string.match() | 7,179,322 Ops/sec |