JavaScript language structure

Source: Internet
Author: User

1. Basic grammar

    • Case sensitive;
    • Longest line matching principle: If a line of words can be parsed into the correct sentence, then follow the rule parsing (even if there is no semicolon), otherwise read a row.

Example: Return

A | | b

will be interpreted as return;

and return a | |

b

will be interpreted as return a | | b

    • tags, for continue and break to identify loops to jump out, by default only matches the inner loop.

2. Operators

    • +: Can manipulate numbers and characters; when numbers are added to characters, numbers are converted to characters; other objects attempt to invoke the valueof () or ToString () method.
    • -: Operable numbers, other objects attempt to invoke the ValueOf () method.
    • *: Similar to-.
    • /: Similar to---returns Nan when the divisor is 0 o'clock returns infinity,0/0.
    • %: and-similar; the result symbol is the same as the first number.
    • + + +--: The value of the expression after the first operation, and vice versa.
    • Nan or undefined participate in a relationship where the result of the comparison is false, and the inverse is true.
    • Null==null returns True
    • Undefined==undefined returns True
    • Undefined==null returns True
    • Null >=undefined return False
    • && | | : If the expression on the left is sufficient to determine the result, then the expression on the right will not execute, return the expression on the left, otherwise return to the right expression, return the value of the expression, and not convert to a Boolean type.

Example: 1 && 2 | | 3 returns 2; 0 && 2 | | 3 returns 3.

    • ,: x = (i = 1, k = 2) equivalent: i = 1; x = k = 2;

JavaScript language structure

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.