当前位置:网站首页>Interesting - questions about undefined
Interesting - questions about undefined
2022-07-06 18:01:00 【free loop 】
about
undefined
This thing , Many of them are used in ordinary development , But we really understand ?
today , Strange knowledge points appear
as everyone knows ,undefined
It's undefined , This is often written in projects :
// Commonly used in initialization
let str = undefined
No problem ! But the great God in the big factory ( Deep well ice ) Will study some magical problems ! Formulate some specifications , To define undefined It has to be written like this .
// It is used like this in big factories
var str=void 0
This is the result
effect : This is to eliminate some hidden dangers
for example :
// If we write like this, there will be a problem
function log(){
var undefined=1// because undefined Not a keyword , It can be defined as
var a=undefined// Declare one more variable a, Its value is undefined
console.log(a)// What to print ???
}
there
undefined
Not in global variablesundefined
, But this declared variableundefined
, So there will be problems with such an assignment , Print the1
.
summary : Although it could be js At the beginning of belt design , The legacy of the bug, But we still need to be meticulous and rigorous in our business .
边栏推荐
- 微信小程序中给event对象传递数据
- Binary search strategy
- Dichotomy (integer dichotomy, real dichotomy)
- PyTorch 提取中间层特征?
- Jielizhi obtains the customized background information corresponding to the specified dial [chapter]
- Basic configuration and use of spark
- 重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...
- Unity小技巧 - 绘制瞄准准心
- How to submit data through post
- The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
猜你喜欢
78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
[rapid environment construction] openharmony 10 minute tutorial (cub pie)
Getting started with pytest ----- test case rules
Spark calculation operator and some small details in liunx
Summary of Android interview questions of Dachang in 2022 (II) (including answers)
What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
开源与安全的“冰与火之歌”
李書福為何要親自掛帥造手機?
PyTorch 提取中间层特征?
Jerry's access to additional information on the dial [article]
随机推荐
Jielizhi obtains the customized background information corresponding to the specified dial [chapter]
Dichotomy (integer dichotomy, real dichotomy)
Mysqlimport imports data files into the database
带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?
What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
J'aimerais dire quelques mots de plus sur ce problème de communication...
d绑定函数
Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
偷窃他人漏洞报告变卖成副业,漏洞赏金平台出“内鬼”
Basic configuration and use of spark
Jerry's setting currently uses the dial. Switch the dial through this function [chapter]
std::true_type和std::false_type
Jerry's updated equipment resource document [chapter]
Why should Li Shufu personally take charge of building mobile phones?
How to use scroll bars to dynamically adjust parameters in opencv
Unity tips - draw aiming Center
MSF横向之MSF端口转发+路由表+SOCKS5+proxychains
Establishment of graphical monitoring grafana
微信小程序中给event对象传递数据