当前位置:网站首页>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 .
边栏推荐
- kivy教程之在 Kivy 中支持中文以构建跨平台应用程序(教程含源码)
- Is it meaningful for 8-bit MCU to run RTOS?
- 开源与安全的“冰与火之歌”
- The difference between parallelism and concurrency
- 容器里用systemctl运行服务报错:Failed to get D-Bus connection: Operation not permitted(解决方法)
- Jerry's setting currently uses the dial. Switch the dial through this function [chapter]
- Shell input a string of numbers to determine whether it is a mobile phone number
- 1700C - Helping the Nature
- STM32按键状态机2——状态简化与增加长按功能
- Four processes of program operation
猜你喜欢

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

關於這次通信故障,我想多說幾句…

队列的实现

Open source and safe "song of ice and fire"

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

node の SQLite

Video fusion cloud platform easycvr adds multi-level grouping, which can flexibly manage access devices

Olivetin can safely run shell commands on Web pages (Part 1)

分布式不来点网关都说不过去

酷雷曼多种AI数字人形象,打造科技感VR虚拟展厅
随机推荐
Run xv6 system
1700C - Helping the Nature
I want to say more about this communication failure
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
Interview assault 63: how to remove duplication in MySQL?
Kill -9 system call used by PID to kill process
JMeter interface test response data garbled
[rapid environment construction] openharmony 10 minute tutorial (cub pie)
Interview shock 62: what are the precautions for group by?
MySQL stored procedure
Running the service with systemctl in the container reports an error: failed to get D-Bus connection: operation not permitted (solution)
微信小程序中给event对象传递数据
Summary of Android interview questions of Dachang in 2022 (II) (including answers)
Distinguish between basic disk and dynamic disk RAID disk redundant array
SQL statement optimization, order by desc speed optimization
scratch疫情隔离和核酸检测模拟 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
Heavy! Ant open source trusted privacy computing framework "argot", flexible assembly of mainstream technologies, developer friendly layered design
OliveTin能在网页上安全运行shell命令(上)
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
李书福为何要亲自挂帅造手机?