Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
111111111111111
(version: 0)
Comparing performance of:
222222222222222222222 vs 3333333333333333333
Created:
5 years ago
by:
Guest
Jump to the latest result
Tests:
222222222222222222222
const currency = [{ usd: 5 }, { uah: 10 }, { usd: 3 }]; // {ysd:8, hrn:10} const result = currency.reduce((res, item) => { for (const [key, value] of Object.entries(item)) { !res[key] ? (res[key] = value) : (res[key] = res[key] + value); } return res; }, {});
3333333333333333333
const currency = [{ usd: 5 }, { uah: 10 }, { usd: 3 }]; // {ysd:8, hrn:10} const merge = (data) => { const res = {}; data.forEach((item) => { for (let [key, value] of Object.entries(item)) { !res[key] ? (res[key] = value) : (res[key] += value); } }); return res; };
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
222222222222222222222
3333333333333333333
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:
Normalize digits
trailingZeroes removal
Compare switch vs dictionary complex 1000
Verifica CNPJ
String to number, parseInt, +, or * 1
Comments
Confirm delete:
Do you really want to delete benchmark?