Javascript Undefined and null

Source: Internet
Author: User
Java code varabcnull; alert (typeofabc); // The returned object here. null is actually a pointer to an empty object. It is no surprise that alert (nullundefined) is returned here ); // return true here, undefined is derived from null, so this... synt

Java code
Var abc = null;
Alert (typeof abc); // The object is returned here. null is actually a pointer to a null object. It is no surprise that all objects are returned here.
Alert (null = undefined); // true is returned here. undefined is derived from null, so true is returned for Equality comparison.
Alert (null = undefined); // here, false is returned. In fact, these two values have different functions. When we define an object, we often initialize the object to null, but undefined, we generally do not show a reputation.

Author: "LoveBeyond"
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.