Js in progress !! Function

Source: Internet
Author: User
Js in progress !! The role is :!! It is generally used to convert the following expression to a boolean data (boolean) js !! The role is:

!! It is generally used to convert the following expression to a boolean data (boolean)

=== Indicates that all the types and other items are equal (just write an if test by yourself)

! = Indicates that you want to include all types (write an if statement as well)

| Or

!! It is generally used to convert subsequent expressions to boolean data (boolean) Because javascript is a weak language (the variable does not have a fixed data type), it is sometimes required to be forcibly converted to the corresponding type,

For example, a = parseInt ("1234") a = "1234" + 0 // convert it to a number B = 1234 + "" // convert it to a string c = someObject. toString () // convert an object to a string, of which 1st and 4th are Explicit conversions,

2. 3 refers to implicit conversion of boolean type. The javascript Convention is similar to c, the rule is: false, undefinded, null, 0, "" is false, true, 1, "somestring", and [Object] is true.

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.