当前位置:网站首页>js基础--运算符
js基础--运算符
2022-06-11 09:14:00 【夺笋123】
算术运算符
完成一系列运算操作的符号
| 运算符 | 描述 |
|---|---|
| + | 加法 |
| - | 减法 |
| * | 乘法 |
| / | 除法 |
| % | 取模(余数) |
| ++ | 自增 |
| – | 自减 |
比较运算符
| 运算符 | 描述 |
|---|---|
| == | 等于 |
| === | 绝对等于(值和类型均相等) |
| != | 不等于 |
| !== | 不绝对等于(值和类型有一个不相等,或两个都不相等) |
| > | 大于 |
| < | 小于 |
| >= | 大于或等于 |
| <= | 小于或等于 |
注意上面的运算符中的===和"!==",两者是js中特殊的一种比较运算符
赋值运算符
| 运算符 | 描述 |
|---|---|
| = | x=y |
| += | x+=y |
| -= | x-=y |
| *= | x*=y |
| /= | x/=y |
| %= | x%=y |
逻辑运算符
| 运算符 | 描述 |
|---|---|
| && | and |
| | | or |
| ! | not |
条件运算符
一种特殊的三目运算符,使用格式如下
var num=a?b:c;
上述语句中num的取值情况如下
n u m = { b , a 为 真 c , a 为 假 num= \begin{cases} b,a为真\\ c,a为假 \end{cases} num={ b,a为真c,a为假
位运算符
| 运算符 | 描述 |
|---|---|
| & | 与 |
| | | 或 |
| ^ | 异或 |
| ~ | 非 |
| << | 左移 |
| >> | 右移 |
| >>> | 填0右移 |
边栏推荐
- Sword finger offer II 041 Average value of sliding window
- Tissu. JS définit dynamiquement la taille de la police
- Output image is bigger (1228800b) than maximum frame size specified in properties (1048576b)
- 机器学习笔记 - 使用TensorFlow的Spatial Transformer网络
- keyboard entry.
- 基于SIC32F911RET6设计的腕式血压计方案
- Day44 database
- [share] how do enterprises carry out implementation planning?
- 面试题 17.10. 主要元素
- A summary of the problem type and method for proving the limit of sequence in postgraduate entrance examination
猜你喜欢

Day44 database

Concurrent programming

Opencv oak-d-w wide angle camera test

OpenCV CEO教你用OAK(五):基于OAK-D和DepthAI的反欺骗人脸识别系统

Technical practice of dolphin dispatching in kubernetes system

Video review pulsar summit Asia 2021, cases, operation and maintenance, ecological dry goods

报错Output image is bigger(1228800B) than maximum frame size specified in properties(1048576B)

山东大学增强现实实验四

关于原型及原型链

Résumé de la méthode d'examen des mathématiques
随机推荐
Customize PCBA scheme and develop wrist sphygmomanometer scheme
考研数学 【数列极限证明题】题型方法总结
【ROS】noedic-moveit安装与UR5模型导入
Kubelet error getting node help
Some learning records I=
Concurrent programming
MSF adds back door to normal program
[FAQ for novices on the road] about data visualization
Day41 process pool and thread pool
Where is it safer to open an account for soda ash futures? How much does it cost to buy at least one hand?
Strength and appearance Coexist -- an exclusive interview with Liu Yu, a member of Apache pulsar PMC
[scheme development] scheme of infrared thermometer
报错[error] input tesnor exceeds available data range [NeuralNetwork(3)] [error] Input tensor ‘0‘ (0)
[software] ten skills to maximize the value of ERP system
A summary of the problem type and method for proving the limit of sequence in postgraduate entrance examination
报错RuntimeError: BlobReader error: The version of imported blob doesn‘t match graph_transformer
【ERP体系】专业技术层面的评估,你了解多少?
2161. 根据给定数字划分数组
ERP体系能帮忙企业处理哪些难题?
OpenCV OAK相机对比及介绍