注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

家居装饰

让每一个人都拥有漂亮的舒服的家!

 
 
 

日志

 
 

javascript运算符及优先级  

2008-10-06 00:12:22|  分类: js |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Table 5-1. JavaScript operators

P

A

Operator

Operand type(s)

Operation performed

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 datatype (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 nonidentity

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 (three operands)

2

R

=

lvalue, any

Assignment

R

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

lvalue, any

Assignment with operation

1

L

,

any

Multiple evaluation

  评论这张
 
阅读(118)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017