Skip to content

Instantly share code, notes, and snippets.

@samuelcotterall
Created April 11, 2012 14:38
Show Gist options
  • Save samuelcotterall/2359722 to your computer and use it in GitHub Desktop.
Save samuelcotterall/2359722 to your computer and use it in GitHub Desktop.
var keywords = new Array("lorem", "ipsum", "dolor");
var input = "Something something dolor something something";
var input2 = "dolor";
// http://documentcloud.github.com/underscore/#indexOf
if (_.indexOf(keywords, input) !== -1){
// false
}
if (_.indexOf(keywords, input2) !== -1){
// true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment