String.prototype.includes vs String.prototype.indexOf27,401,176 ops/sec
27,319,386 ops/sec
Fastest: String.prototype.indexOf (16266.0x faster)
1,960,882,176 ops/sec
120,551 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| String.prototype.includes | |
| String.prototype.indexOf |
| Test name | Executions per second |
|---|---|
| ✓ String.prototype.includes | 168,954,736 Ops/sec |
| String.prototype.indexOf | 162,151,600 Ops/sec |