当前位置:网站首页>Interesting - questions about undefined
Interesting - questions about undefined
2022-07-06 18:01:00 【free loop 】
about
undefinedThis 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
undefinedNot 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 .
边栏推荐
- 分布式不来点网关都说不过去
- The art of Engineering (2): the transformation from general type to specific type needs to be tested for legitimacy
- EasyCVR电子地图中设备播放器loading样式的居中对齐优化
- I want to say more about this communication failure
- Scratch epidemic isolation and nucleic acid detection Analog Electronics Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
- 趣-关于undefined的问题
- Open source and safe "song of ice and fire"
- Mysqlimport imports data files into the database
- VR全景婚礼,帮助新人记录浪漫且美好的场景
- 带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
猜你喜欢

EasyCVR接入设备开启音频后,视频无法正常播放是什么原因?

重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...

Summary of Android interview questions of Dachang in 2022 (II) (including answers)

Today in history: the mother of Google was born; Two Turing Award pioneers born on the same day

FlutterWeb浏览器刷新后无法回退的解决方案

李书福为何要亲自挂帅造手机?

After entering Alibaba for the interview and returning with a salary of 35K, I summarized an interview question of Alibaba test engineer

Appium automated test scroll and drag_ and_ Drop slides according to element position

How to solve the error "press any to exit" when deploying multiple easycvr on one server?

QT中Model-View-Delegate委托代理机制用法介绍
随机推荐
Solution qui ne peut pas être retournée après la mise à jour du navigateur Web flutter
STM32按键状态机2——状态简化与增加长按功能
Pytest learning ----- pytest operation mode and pre post packaging of interface automation testing
Why should Li Shufu personally take charge of building mobile phones?
MSF horizontal MSF port forwarding + routing table +socks5+proxychains
EasyCVR平台通过接口编辑通道出现报错“ID不能为空”,是什么原因?
The art of Engineering
Hongmeng introduction and development environment construction
Compile and build, from the bottom to the top
Olivetin can safely run shell commands on Web pages (Part 1)
Summary of Android interview questions of Dachang in 2022 (II) (including answers)
8位MCU跑RTOS有没有意义?
Establishment of graphical monitoring grafana
The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly a hundredfold performance improvement
Getting started with pytest ----- test case pre post, firmware
High precision operation
Sqoop I have everything you want
Dichotomy (integer dichotomy, real dichotomy)
[introduction to MySQL] the first sentence · first time in the "database" Mainland
Spark accumulator and broadcast variables and beginners of sparksql