当前位置:网站首页>What is the meaning of void 0? Is undefined changeable?
What is the meaning of void 0? Is undefined changeable?
2022-07-24 17:01:00 【InfoQ】
Preface
explain
1,
void
It needs to be followed by an expression , All statements in the expression will be executed .
voidundefinedvoid console.log(" Hello everyone , I'm the Antarctic ice ") // Console printing “ Hello everyone , I'm the Antarctic ice ”
void alert(" Hello everyone , I'm the Antarctic ice ") // The browser pops up “ Hello everyone , I'm the Antarctic ice ”
void 1+2 // return NAN, Think about why ???
// This is because 1+2 It's not added outside (), By default, execute from left to right ,void 1 by undefined,undefined+2 by NAN
void (1+2) // The return value is undefined
2,
void
The return value is always
undefined
let a = void 0
console.log(a) // The result is undefined
let a = console.log(" Hello everyone , I'm the Antarctic ice ")
console.log(a) // The result is undefined
let a = void alert(" Hello everyone , I'm the Antarctic ice ")
console.log(a) // The result is undefined
let a = void (1+2)
console.log(a) // The result is undefined
3,
undefined
It can be redefined in local variables
function fun(){
let undefined = 10
console.log(undefined)
}
fun() // At this time, the printed undefined by 10
void 0void(0)undefinedundefinedundefinedundefinedvoidundefinedvoid 0undefinedvoid 1undefinedPostscript
边栏推荐
- Want to make sandbox games? Then you must not miss this plug-in (unity3d)
- [leetcode] skillfully use bit operation
- 1184. 公交站间的距离
- Buffer overflow vulnerability lab experiment record
- IP的概念,IP的分类,IP复用技术
- Concept of IP, classification of IP, IP multiplexing technology
- Explain Apache Hudi schema evolution in detail
- Digital transformation must have digital thinking
- Problems encountered in upgrading chrome to version 80 - solutions to system login failure
- Simply use MySQL index
猜你喜欢

Method of querying comma separated strings in a field by MySQL

Thinkphp3.2.5 cannot jump to external links

我们为什么要推出Getaverse?
[redis] -1. two ways of setting up environment based on docker

Envi grid resampling

Want to make sandbox games? Then you must not miss this plug-in (unity3d)

MySQL basic commands

Comparison of array and object merging methods assign, merge, defaults, defaultsdeep in lodash

Cann training camp learns the animation stylization and AOE ATC tuning of the second season of 2022 model series

查数据库实际数据增长情况
随机推荐
Using unity to do simulation, I don't allow this chart plug-in, you don't know
Check the actual data growth of the database
为什么被调函数内部不能用 sizeof(arr) / size(arr[0]) 计算数组长度?
QT keyboard event (I) -- detect key input
thinkphp3.2.5无法跳转到外部链接
[sequential logic circuit] - counter
【技术】uniapp 之 在线选座 demo
安全的证券公司有哪些?我想在手机上买股票
QT keyboard event (II) -- long press the key to trigger the event event repeatedly, and the problem is solved
我们为什么要推出Getaverse?
At & T pseudo instruction and interpretation of CFI CFA
QT generation connection Library
Picture browser? QT can also be achieved!
JSP custom tag library -- select tag
ArcGIS layer annotation display
JS simulation realizes the principles of call, apply, bind and new
804. Unique Morse code word
[redis] -1. two ways of setting up environment based on docker
Mysql增删改查、检索与约束(详细教学)
IP的概念,IP的分类,IP复用技术