Knowledge about operators in js

一个新手
Release: 2017-10-20 10:54:50
Original
1060 people have browsed it

The

operator is used to perform program code operations and will perform operations on one or more operand items. 2+3, its operands are 2 and 3, and 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. During the running of the program, we perform operations on the data according to the corresponding rules as needed to obtain the expected results. Operations Symbols are the rules of operation.

Operators The basic commonly used operators in js include the following categories:

Assignment operator

Arithmetic operators

++: Divided into pre-add and post-add, When ++ comes first, it will be incremented by 1 first and then used; when ++ comes after, it will be used first and then incremented. And so on -- the same thing.

Connection operator: +

When "+" is applied to a non-numeric operator, it means Connect, perform a simple splicing operation on the operands

Comparison operator

Logical Operators

|, ||: If it is true, it is true

&, &&: If it is false, it is false

## Conditional operator(Original by Shanghai Shangxuetang web front-end training, please pay more attention, there will be articles related to JS and other front-end technologies)

The above is the detailed content of Knowledge about operators in js. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!