I have a set of String values in Javascript, and I need to write a function that detects if another specific String value belongs to this set or not. What is the fastest way to achieve this? Is it all right to put the set of values into an array, and then write a function that searches through the array? I think if I keep the values sorted and do a binary search, it should work fast enough. Or is there some other smart way of doing this, which can work faster?
Thanks.