Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Test values #3
(version: 0)
Test values
Comparing performance of:
Test 1 vs Test 2 vs Test 3
Created:
6 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
function objectValues1(object) { const t = []; for(var key in object) { t.push(object[key]); } return t; } function objectValues2(object) { return Object.keys(object).map(k => object[k]) } var a = {}; for(let i = 0; i < 500; ++i) { a[i] = i + 0.5; }
Tests:
Test 1
let b = Object.values(a);
Test 2
let b = objectValues1(a);
Test 3
let b = objectValues2(a);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Test 1
Test 2
Test 3
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:
Reading object values in loop: Object.keys vs Object.values
Test values
For in vs Object.*.forEach vs Object.values with equal usage
For in vs Object.*.forEach vs Object.values 2
Comments
Confirm delete:
Do you really want to delete benchmark?