JavaScript Advanced (1)---operator

Source: Internet
Author: User

JavaScript operators

1. The comparison between "= = =" and "= =" in JavaScript

In short: the "= = =" Requirement type is equal to the value.

"= =" Requires only equal values

var num_str= "1";  // Num_str is a character variable num_str   = =  1; // result is true  = = = 1; // the values are the same, but the types are different. The result is false1===1; // value is the same as type, return true1===2;// type Same, value different, return false

2, about "| |" With the "&&" logical character

With a| | B and C&&d

A and B need only one to be true and the whole to be true

C and D only need to have one false, then the overall value is False

Note: If A is true, then part B will not need to be executed .

     if C is false, then part D does not need to be executed .

      (JavaScript is not performed by default)

2. Precedence between operators   

  arithmetic Operators > comparison operators > logical Operators > assignment equals "="

JavaScript Advanced (1)---operator

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.