Consider the following code:
var sentences = [ \'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\', \'Vivamus aliquet nisl quis
return true not work
return false working
found = false; query = "foo"; $('.items').each(function() { if($(this).text() == query) { found = true; return false; } });