indexOf() + 1 vs indexOf() != -1 When checking for existence of a substring I have been doing this:

var that = "ok hello cool";    
if( that.indexOf('hello') + 1 ) {
}


Instead of:  

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


Am I overlooking something or is there a reason not to do this.

Update:

Yes, I was indeed unaware of the even simpler method of:

if ( ~that.indexOf( 'hello' ) ) {

}


You can read about the ~ bitwise operator and the other queer bitwise operators here: 
https://developer.mozilla.org/en/JavaScript/Reference/Operators/Bitwise_Operators
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.