Let's get started!
VM73:13 Object.keys took: 20234.000000054948msecs
VM73:19 Object.values took: 5987.800000002608msecs
It turns out that Object.values
is about 3.2
times faster than Object.keys
in Chrome v67
.
Note: Things might change in the future and I've only tested it in Chrome really, so take the results with a grain of salt!
It seems Chrome and Firefox as massively faster with
values
. Safari is slightly faster withkeys
, and Edge (reported as Chrome 51 here) is 3x faster withkeys
https://jsperf.com/object-keys-vs-values/1