当前位置:网站首页>js运算符的优先级
js运算符的优先级
2022-06-28 08:06:00 【庸懒】
js运算符的优先级
因为最近被js的一个typeof的优先级搞得头皮发麻,所以记录一下完整的js运算符优先级
| 优先级 | 运算类型 | 关联性 | 运算符 |
|---|---|---|---|
| 21 | 圆括号 | n/a(不相关) | () |
| 20 | 成员访问 | 从左到右) | . |
| 20 | 需计算的成员访问 | 从左到右) | [] |
| 20 | new (带参数列表) | n/a | new … ( … ) |
| 20 | 函数调用 | 从左到右) | … ( … ) |
| 20 | 可选链(Optional chaining) | 从左到右) | ?. |
| 19 | new (无参数列表) | 从右到左 | new … |
| 18 | 后置递增(运算符在后) | n/a | … ++ |
| 18 | 后置递减(运算符在后) | n/a | … – |
| 17 | 逻辑非 | 从右到左 | ! … |
| 17 | 按位非 | 从右到左 | ~ … |
| 17 | 一元加法 | 从右到左 | + … |
| 17 | 一元减法 | 从右到左 | - … |
| 17 | 前置递增 | 从右到左 | ++ … |
| 17 | 前置递减 | 从右到左 | –… |
| 17 | typeof | 从右到左 | typeof |
| 17 | void | 从右到左 | void |
| 17 | delete | 从右到左 | delete |
| 17 | await | 从右到左 | await |
| 16 | 幂 | 从右到左 | … ** … |
| 15 | 乘法 | 从左到右 | … *… |
| 15 | 除法 | 从左到右 | … /… |
| 15 | 取模 | 从左到右 | … %… |
| 14 | 加法 | 从左到右 | … +… |
| 14 | 减法 | 从左到右 | … -… |
| 13 | 按位左移 | 从左到右 | … << … |
| 13 | 按位右移 | 从左到右 | … >>… |
| 13 | 无符号右移 | 从左到右 | … >>> … |
| 12 | 小于 | 从左到右 | … < … |
| 12 | 小于等于 | 从左到右 | … <= … |
| 12 | 大于 | 从左到右 | … <>… |
| 12 | 大于等于 | 从左到右 | … >= … |
| 12 | in | 从左到右 | … in … |
| 12 | instanceof | 从左到右 | … instanceof … |
| 11 | 等号 | 从左到右 | … ==… |
| 11 | 非等号 | 从左到右 | … !=… |
| 11 | 全等号 | 从左到右 | … ===… |
| 11 | 非全等号 | 从左到右 | … !==… |
| 10 | 按位与 | 从左到右 | … &… |
| 9 | 按位异或 | 从左到右 | … ^… |
| 8 | 按位或 | 从左到右 | … 1… |
| 7 | 逻辑与 | 从左到右 | … &&… |
| 6 | 逻辑或 | 从左到右 | 11 |
| 5 | 空值合并 | 从左到右 | … ?? … |
| 4 | 条件运算符 | 从右到左 | … ? … : |
| 3 | 赋值 | 从右到左 | … =、+=等符号… |
| 2 | yield | 从右到左 | yield … |
| 2 | yield* | 从右到左 | yield* … |
| 1 | 展开运算符 | n/a | … |
| 0 | 逗号 | 从右到左 | , |
因为编辑器的原因在表格中无法打出
|符号,所以这里使用1代替,请注意区别。
边栏推荐
- HJ explicit random number
- Do you know TCP protocol (1)?
- How redis solves cache avalanche, breakdown and penetration problems
- 本周二晚19:00战码先锋第8期直播丨如何多方位参与OpenHarmony开源贡献
- 你了解TCP协议吗(一)?
- Kubernetes cluster command line tool kubectl
- asp. Net to search products and realize paging function
- 城联优品向英德捐赠抗洪救灾爱心物资
- sql分析(查询截取分析做sql优化)
- 你了解TCP协议吗(二)?
猜你喜欢

Activity隐式跳转

Ambari (V) ---ambari integrated Azkaban (valid for personal test)

Section 9: dual core startup of zynq

asp. Net datalist when there are multiple data displays

MySQL implements transaction persistence using redo logs

A single node obtains the lock lock of the order number

Activity implicit jump

Soft exam -- software designer -- afternoon question data flow diagram DFD

asp. Net datalist to display product information and pictures

Vagrant installation
随机推荐
Redis one master multi slave cluster setup
Redis uses sentinel master-slave switching. What should the program do?
HJ string sort
The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
Study notes 22/1/17
Software testing and quality final review
Activity隐式跳转
抗洪救灾,共克时艰,城联优品捐赠10万元爱心物资驰援英德
Idea package together, using compact middle packages to solve &
Vagrant installation
asp. Net registration page
Devops Basics: Jenkins deployment and use (I)
Static resource compression reduces bandwidth pressure and increases access speed
B_QuRT_User_Guide(30)
HJ delete the character with the least number of occurrences in the string
Redis cerebral fissure
MySQL installation and environment variable configuration
Hash slot of rediscluster cluster cluster implementation principle
NLP sequence can completely simulate human brain intelligence
Unity 获取当前物体正前方,一定角度、距离的坐标点