About the things that are null and undefined.

Source: Internet
Author: User

There are many explanations on the internet about null and undefined, so today we will briefly talk about the topic of null and undefined, in order to solve their mystery, of course, this is a simple introduction, in the future there are corresponding updates.

Why undefined is equal to null when using = =

If you know that JavaScript has an implicit conversion, then I think you should know what's going on, and when comparing undefined with null, undefined will be converted to False,null also Fasle, if NULL is converted to a number, Null is 0, of course this is not the point of this chapter to say. Then say null and undefined, because two are converted to false nature is equal, if it is = = = that is not the same, because = = = is not the implicit conversion (that is, type conversion), since the conversion is not done, then undefined will not be equal to NULL.

The difference between undefined and null: 1

1 Number (undefined) 2 NaN3 number (NULL) 4 0

Say this today, sometimes we continue to talk, if you have more understanding, you can give me a reply.

About the things that are null and undefined.

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.