JavaScript Building JS operator

Source: Internet
Author: User
Tags arithmetic operators logical operators

Operator is used to execute program code operations and is calculated for one or more operand items. 2+3, whose operands are 2 and 3, while the operator is "+". In the previous article we said that variables are used to store data, and the data in the same variable can be different at different times, in the process of running the program, we need to do the corresponding rules of the operation of the data to achieve the desired results, operators are the rules of the operation.

Operators in JS have the following classes of basic common operators:

Assignment operators

Arithmetic operators

+ +: is divided into pre-plus and post-plus, when + + in front, then the first self-increment 1 and then use, when + + in the latter, then the first use of self-increment. And so on--the same.

Join operator: +

When the "+" is applied on a non-numeric operator, the connection is made, and the operand is simply spliced.

Comparison operators

logical operators

|, | | | : True and True

&, &&: false or False

conditional operator (Shanghai Shang Academy web Front End Training original, please pay more attention, successively have JS and other front-end technology related articles on)

JavaScript Building JS 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: [email protected] 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.