How do you check null in jQuery?



  • AJAX is returning the object json. In some cases json may be null. How's it best to check the target on null? Is it correct to use this verification if(json)?



  • Canon decision on jQuery:

    if (jQuery.type( proveryamaya_peremennaya ) === "null") {
        console.log('eto null');
    } else {
        console.log('eto ne null (sic!)');
    }
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2