Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.reduce vs. Object.fromEntries + Array.map
(version: 0)
Comparing performance of:
Array.reduce vs Object.fromEntries + Array.map
Created:
5 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var data = Array.from(new Array(1000), (_, index) => ({ type: `prop${index}`, result: index }));
Tests:
Array.reduce
data.reduce((acc, { type, result }) => { return { ...acc, [type]: result } })
Object.fromEntries + Array.map
Object.fromEntries(data.map(({ type, result }) => [type, result]));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.reduce
Object.fromEntries + Array.map
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
reduce (immutable) vs map + fromEntries
Object.fromEntries vs create temp object vs Array.reduce
Map & Object.fromEntries vs reduce
Object.fromEntries on array vs reduce on array
Object.fromEntries vs reduce round 2
Comments
Confirm delete:
Do you really want to delete benchmark?