DEV Community

Discussion on: Time complexity Big 0 for Javascript Array methods and examples.

Collapse
 
axibord profile image
Aghiles Lounis

@luiscastillokc for the method "indexOf" I think it's O(log(n)) time, because it uses something like Binary search

Collapse
 
konstantin_kulikov_5503ba profile image
Konstantin Kulikov

Binary search can only be executed on a sorted collection