Test case name | Result |
---|---|
_.mapValues(collection, () => "a") | |
Object.keys(collection).reduce( (acc, item) => ({ ...acc, [item]: "a", }), {} ) |
Test name | Executions per second |
---|---|
_.mapValues(collection, () => "a") | 43020.8 Ops/sec |
Object.keys(collection).reduce( (acc, item) => ({ ...acc, [item]: "a", }), {} ) | 32801.5 Ops/sec |