Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.values vs array index loop
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 14; Mobile; rv:138.0) Gecko/138.0 Firefox/138.0
Browser:
Firefox Mobile 138
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Object values
2914647.0 Ops/sec
Array values
6622147.5 Ops/sec
Script Preparation code:
var obj = {"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"10":10}; var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
Tests:
Object values
Object.values(obj).map((a) => a );
Array values
arr.map((a) => a);