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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
An interesting add to this article would be benchmarks to see which is the most efficient method?
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.