getOwnPropertyNames vs for ... inFastest: for ... in (1.6x faster)
27,688,008 ops/sec
17,357,724 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| getOwnPropertyNames | |
| for ... in |
| Test name | Executions per second |
|---|---|
| ✓ for ... in | 62,834,376 Ops/sec |
| getOwnPropertyNames | 46,521,324 Ops/sec |