I\'m learning lodash. Is it possible to use lodash to find a substring in an array of strings?
var myArray = [
\'I like oranges and apples\',
\'I hat
Two quick ways to do it - neither uses lodash (sorry)
var found = myArray.filter(function(el){
return el.indexOf('oranges') > -1;
}).length;
if (found) { // oranges was found }
or as I mentioned in the comment:
var found = myArray.join(',').indexOf('oranges') > -1;
if (found) { // oranges was found }