Run details:
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 YaBrowser/18.9.0.3409 Yowser/2.5 Safari/537.36
Yandex Browser 18
Windows 8.1
Desktop
6 years ago
Test name Executions per second
for...in 1548.8 Ops/sec
Object.keys+forEach (ES5) 2267.1 Ops/sec
for...of - keys (ES6) 2327.0 Ops/sec
for...of - values (ES6) 2004.4 Ops/sec
for...of - entries (ES6) 1554.2 Ops/sec
Object.entries (ES8) 1536.2 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)