Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36
Chrome 100
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Object.keys - get all values 81.2 Ops/sec
Object.values - get all values 4519.3 Ops/sec
Object.entries - get all values 132.1 Ops/sec
Object.keys - get first 439.0 Ops/sec
Object.values - get first value 4511.6 Ops/sec
Object.entries - get first value 153.5 Ops/sec
Script Preparation code:
Tests:
  • Object.keys - get all values

  • Object.values - get all values

  • Object.entries - get all values

  • Object.keys - get first

  • Object.values - get first value

  • Object.entries - get first value