Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Chrome 102
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
Object.keys - get all values 46.3 Ops/sec
Object.values - get all values 2998.1 Ops/sec
Object.entries - get all values 70.3 Ops/sec
Object.keys - get first 243.7 Ops/sec
Object.values - get first value 2974.7 Ops/sec
Object.entries - get first value 78.2 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