Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
test iteration
(version: 0)
Comparing performance of:
obj key vs indexOf vs arr index
Created:
7 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var obj = { '1': 1, '2': 2, '3': 3 }; var arr = [{id:1}, {id:2}, {id:3}];
Tests:
obj key
obj['2'];
indexOf
arr.indexOf(el => el.id === 2)
arr index
arr[1]
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
obj key
indexOf
arr index
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:
Array clone
inclues vs dot notation
Array: get last item
Testing Spread 21062023
Comments
Confirm delete:
Do you really want to delete benchmark?