If Not (oResponse.selectSingleNode("BigGroupType") Is Nothing) Then
End If
I need to convert this to javascript. Is that enough to check null?
This was my lead’s answer, plz verify this,
if(typeof $(data).find("BigGroupType").text() != "undefined" && $(data).find("BigGroupType").text() != null) {
}
JavaScript has two values which mean “nothing”,
undefinedandnull.undefinedhas a much stronger “nothing” meaning thannullbecause it is the default value of every variable. No variable can benullunless it is set tonull, but variables areundefinedby default.If you want to check to see if something is
undefined, you should use===because==isn’t good enough to distinguish it fromnull.However, this can be useful because sometimes you want to know if something is
undefinedornull, so you can just doif (value == null)to test if it is either.Finally, if you want to test whether a variable even exists in scope, you can use
typeof. This can be helpful when testing for built-ins which may not exist in older browsers, such asJSON.