Created
February 16, 2016 10:50
-
-
Save mityukov/8b2765b29f778ff012b6 to your computer and use it in GitHub Desktop.
Check string has any of array's values in it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function substr_in_array(arr, str) | |
{ | |
return arr.some( function(v) { return str.indexOf(v) >= 0; } ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment