String.prototype.includes() vs String.prototype.indexOf() vs RegExp.prototype.test()| Test case name | Result |
|---|---|
| String.prototype.includes() | |
| String.prototype.indexOf() | |
| RegExp.prototype.test() |
| Test name | Executions per second |
|---|---|
| ✓ String.prototype.indexOf() | 82,155,056 Ops/sec |
| String.prototype.includes() | 79,373,632 Ops/sec |
| RegExp.prototype.test() | 40,416,016 Ops/sec |