Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
indexOf VS object
(version: 0)
Comparing performance of:
indexOf found vs indexOf not found vs object found vs object not found
Created:
5 years ago
by:
Guest
Jump to the latest result
Tests:
indexOf found
const arr = [1,2,3,4,5,6,7,8,9,10]; let isFound = (-1 != arr.indexOf(8));
indexOf not found
const arr = [1,2,3,4,5,6,7,8,9,10]; let isFound = (-1 != arr.indexOf(12));
object found
const obj = {1 : true,2 : true,3 : true,4 : true,5 : true,6 : true,7 : true,8 : true,9 : true,10 : true}; let isFound = (obj["8"]);
object not found
const obj = {1 : true,2 : true,3 : true,4 : true,5 : true,6 : true,7 : true,8 : true,9 : true,10 : true}; let isFound = (obj["12"]);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
indexOf found
indexOf not found
object found
object not found
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:
index vs lastindexof startsWith
index vs lastindexof empty
index vs lastindexof empty with startIndex set to 0
JavaScript search() vs indexOf()
String.indexOf(char) vs String.indexOf(char, position)
Comments
Confirm delete:
Do you really want to delete benchmark?