Monica Shiralkar wrote:However what I fail to understand is why myVar!=null returned false in the same case.
Monica Shiralkar wrote:So , if the code thus sees myVar as undefined and undefined is equal to null then shouldn't if(myVar!=null) return false ?
Stephan van Hulst wrote:So, above your if statement, can you add console.log(searchKeyword) and also console.log(typeof searchKeyword) and tell us what your developer tools display?
Monica Shiralkar wrote:If(myVar) is the only one out of the three which returned False.
Monica Shiralkar wrote:If(myVar!='') returned True
Monica Shiralkar wrote:I am thinking that if(mySearchParam) is a null check
Bear Bibeault wrote:If you specifically want to check against the empty string, then be explicit about it: Note the explicit operator: !==