charCodeAt(0) vs charCodeAt(300) vs [0] vs [10]31,786,564 ops/sec
31,543,690 ops/sec
31,459,262 ops/sec
31,317,798 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| charCodeAt(0) | |
| charCodeAt(300) | |
| [0] | |
| [10] |
| Test name | Executions per second |
|---|---|
| ✓ charCodeAt(300) | 157,864,384 Ops/sec |
| charCodeAt(0) | 157,620,080 Ops/sec |
| [0] | 154,631,984 Ops/sec |
| [10] | 145,157,776 Ops/sec |