JavaScript operators (from rule Crip: The definitive guide, 4th guide)

Source: Internet
Author: User
Table 5-1. JavaScript operators

P

A

Operator

Operand type (s)

Operation completed MED

15

L

.

Object, identifier

Property access

 

L

[]

Array, integer

Array index

 

L

()

Function, arguments

Function call

 

R

New

Constructor call

Create new object

14

R

++

Lvalue

Pre-or post-increment (unary)

 

R

--

Lvalue

Pre-or post-decrement (unary)

 

R

-

Number

Unary minus (negation)

 

R

+

Number

Unary plus (no-op)

 

R

~

Integer

Bitwise complement (unary)

 

R

!

Boolean

Logical complement (unary)

 

R

Delete

Lvalue

Undefine a property (unary)

 

R

Typeof

Any

Return data type (unary)

 

R

Void

Any

Return undefined value (unary)

13

L

*,/, %

Numbers

Multiplication, division, remainder

12

L

+ ,-

Numbers

Addition, subtraction

 

L

+

Strings

String concatenation

11

L

<

Integers

Left shift

 

L

>

Integers

Right shift with sign-extension

 

L

>>>

Integers

Right shift with zero extension

10

L

<, <=

Numbers or strings

Less than, less than or equal

 

L

>,>=

Numbers or strings

Greater than, greater than or equal

 

L

Instanceof

Object, constructor

Check object type

 

L

In

String, object

Check whether property exists

9

L

=

Any

Test for equality

 

L

! =

Any

Test for inequality

 

L

===

Any

Test for identity

 

L

! =

Any

Test for non-identity

8

L

&

Integers

Bitwise AND

7

L

^

Integers

Bitwise XOR

6

L

|

Integers

Bitwise OR

5

L

&&

Booleans

Logical AND

4

L

|

Booleans

Logical OR

3

R

? :

Boolean, any, any

Conditional operator (3 operands)

2

R

=

Lvalue, any

Assignment

 

R

* =,/=, % =, + =, -=, <<=, >=, >>=, <=, ^ =, | =

Lvalue, any

Assignment with operation

1

L

,

Any

Multiple evaluation

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.