当前位置:网站首页>JS learning notes - operators
JS learning notes - operators
2022-07-02 16:04:00 【Dumb monkey】
Operator ( operator ) Also known as the operator , Is used to implement assignment 、 Symbols that compare and perform functions such as arithmetic operations .

The precision of floating point numbers
The highest precision of a floating-point value is 17 Decimal place , But the accuracy of arithmetic calculation is far less than integer .
Increment and decrement operators
If you need to add or subtract numbers repeatedly 1 , have access to Increasing ( ++ ) And decline ( -- ) Operator To complete .
stay JavaScript in , Increasing ( ++ ) And decline ( -- ) You can put it in front of a variable , You can also put it after variables . When you put it in front of a variable , We can call it Pre increment ( Decline ) Operator , When you put it after a variable , We can call it Post increment ( Decline ) Operator .
Increment and decrement operators must be used with variables .
Pre increment and post increment operators can simplify the writing of code , Let the value of the variable + 1 Easier to write than before
When used alone , The running results are the same , When used with other code , The execution results will be different .
After : First the original value operation , Post autoplus ( Put the interest of others above one's own )
In front of : Add it first , Post operation ( First, then )
Comparison operator

The equal sign in our program is == Default conversion data type Will convert string data to numeric data
Logical operators
Logical operators are used to Operators that perform Boolean operations , Its return value is also Boolean .

Logic and && and On both sides true The result is true As long as there is Side is false The results for false
Logic or || or On both sides false It turns out to be false false As long as there is one Side is true junction The result is true
Logic is not (!) It's also called the negation , Used to take a value that is the opposite of a Boolean value , Such as true The opposite of this is false
Short-circuit operation ( Logic break )
Logic and short circuit operation
The principle of short circuit operation : When there are multiple expressions ( value ) when , When the value of the expression on the left can determine the result , The value of the expression on the right will no longer be evaluated ;
Logic and short circuit operation : If the expression 1 The result is true , Then return the expression 2. If the expression 1 For false , Then the return expression 1
If the empty or negative is false, the rest is true .eg: 0 ' ' null undefined NaN
Logic or short circuit operation
Logical or short circuit operation if expression 1 If the result is true, the expression is returned 1 If the expression 1 Returns an expression if the result is false 2
Assignment operator

Operator priority

边栏推荐
- Multi data source configuration code
- idea jar包冲突排查
- [idea] recommend an idea translation plug-in: translation "suggestions collection"
- 又是一年毕业季
- 微信v3native支付设置的结束时间处理办法
- 可视化技术在 Nebula Graph 中的应用
- Astra: could not open "2bc5/ [email protected] /6“: Failed to set USB interface
- Comparison between rstan Bayesian regression model and standard linear regression model of R language MCMC
- AWS云主机扩容
- Invalid bound statement (not found)解决方法总结
猜你喜欢

Crawl the information of national colleges and universities in 1 minute and make it into a large screen for visualization!

Introduction to dynamic planning I, BFS of queue (70.121.279.200)

win10系统升级一段时间后,内存占用过高

Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys

Aiko ai Frontier promotion (7.2)

Comment réaliser un graphique Nebula d'importation CSV hors ligne de niveau milliard

Boot transaction usage

Summary of multithreading and thread synchronization knowledge

Introduction to Dynamic Planning II (5.647.62)

全是精华的模电专题复习资料:基本放大电路知识点
随机推荐
QVariant与Json的各种纠葛——Qt
Pattern matching extraction of specific subgraphs in graphx graph Computing Practice
Use ffmpeg command line to push UDP and RTP streams (H264 and TS), and ffplay receives
[solution] educational codeforces round 82
Flink real-time data warehouse (7): Flink realizes the full pull module to extract data in MySQL
Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse
Ant group's large-scale map computing system tugraph passed the national evaluation
PyObject 转 char* (string)
Make p12 certificate [easy to understand]
[5g NR] RRC connection release
可视化技术在 Nebula Graph 中的应用
Why does the system convert the temp environment variable to a short file name?
Invalid bound statement (not found) solution summary
全方位解读服务网格(Service Mesh)的背景和概念
源码look me
MySQL calculates the data within the longitude and latitude range
Lseek error
Another graduation season
Boot 事务使用
(万字精华知识总结)Shell脚本编程基础知识