Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Firefox 114
Windows
Desktop
one year ago
Test name Executions per second
for...in 29397.5 Ops/sec
Object.keys+forEach (ES5) 21598.5 Ops/sec
for...of - keys (ES6) 21942.2 Ops/sec
for...of - values (ES6) 42381.7 Ops/sec
for...of - entries (ES8) 12698.4 Ops/sec
Object.entries (ES8) 16530.3 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)