refactoring _.contains to use native javascript