Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Chrome 116
Linux
Desktop
10 months ago
Test name Executions per second
for...in 2175.3 Ops/sec
Object.keys+forEach (ES5) 3379.0 Ops/sec
for...of - keys (ES6) 3302.7 Ops/sec
for...of - values (ES6) 3153.5 Ops/sec
for...of - entries (ES8) 2561.3 Ops/sec
Object.entries (ES8) 2599.8 Ops/sec
Script Preparation code:
Tests:
  • for...in

  • Object.keys+forEach (ES5)

  • for...of - keys (ES6)

  • for...of - values (ES6)

  • for...of - entries (ES8)

  • Object.entries (ES8)