Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Created October 31, 2011 01:30
Show Gist options
  • Select an option

  • Save aaronpowell/1326706 to your computer and use it in GitHub Desktop.

Select an option

Save aaronpowell/1326706 to your computer and use it in GitHub Desktop.
Q15 - What's the index?
var foo = 'abcd';
if ( foo.indexOf('a') >= 0 ) {
console.log ( 'we have a match!' );
} else {
console.log ( 'this is not the value you\'re looking for' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment