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() | 1,672,710,016 Ops/sec |
| text.includes() | 1,668,988,800 Ops/sec |
| regex.test() | 32,386,708 Ops/sec |
| string.match() | 20,650,372 Ops/sec |