for-in vs Object.keysFastest: for-in (1.2x faster)
6 ops/sec
5 ops/sec
2 ops/sec
2 ops/sec
Fastest: for-in (1.2x faster)
24 ops/sec
20 ops/sec
Fastest: for-in (1.2x faster)
2 ops/sec
2 ops/sec
Fastest: for-in (1.3x faster)
26 ops/sec
20 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| for-in | |
| Object.keys |
| Test name | Executions per second |
|---|---|
| ✓ for-in | 7 Ops/sec |
| Object.keys | 6 Ops/sec |