var obj = {};
for (let i = 0; i < 1000; i++) {
obj['abc_' + i] = i;
}
Object.keys(obj);
Object.values(obj);
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
Object.keys | |
Object.values |
Test name | Executions per second |
---|---|
Object.keys | 79368.5 Ops/sec |
Object.values | 59075.7 Ops/sec |