Is there a way in lodash to check if a strings contains one of the values from an array?
For example:
var text = \'this is some sample text\';
var values
No. But this is easy to implement using String.includes. You don't need lodash.
Here is a simple function that does just this:
function multiIncludes(text, values){
return values.some(function(val){
return text.includes(val);
});
}
document.write(multiIncludes('this is some sample text',
['sample', 'anything']));
document.write('
');
document.write(multiIncludes('this is some sample text',
['nope', 'anything']));