Skip to main content
2 of 2
added code relevant to "the second one" from question

Well, I believe the second one is more obvious what's going on...

if( that.indexOf('hello') != -1 ) {
}

That's all to it however, both expressions are valid and perfectly ok.

walther
  • 358
  • 2
  • 9