DEV Community

Discussion on: Is item in array?

Collapse
 
martin2844 profile image
martin2844

An interesting add to this article would be benchmarks to see which is the most efficient method?

Collapse
 
tnifey profile image
Hub

I made a quick benchmark with that code.
jsbench.me/5xkmowvikx/1

It seems that includes is the fastest on Chrome, on Firefox indexOf and bitwise is the winner. On Firefox on Android seems like its includes and bitwise are winners.

The slowest method is using Set.