当前位置:网站首页>JS function and variable have the same name (function and variable parsing rules)
JS function and variable have the same name (function and variable parsing rules)
2022-06-12 04:22:00 【Blue island】
console.log(a)
var a = 3
function a(){}
- 1.
- 2.
- 3.
Print :ƒ a() {}
analysis :
1、 The function declaration will be at the top , Variable declarations will be at the top , Function declarations are more important than variable declarations
2、 Variable declaration and assignment are written together (var),js When parsing, the engine will split it into two parts: Declaration and assignment , The statement tops , The resolution remains in its original position ( This only refers to var The way ,let and const Has block level scope , And the declared variables are not mounted to window On )
3、 Declared variables will not be declared repeatedly
The above expression is equivalent to :
function a() {}
var a
console.log(a)
a = 3
- 1.
- 2.
- 3.
- 4.
边栏推荐
- D1 哪吒开发板 上电记录
- [C language] encapsulation interface (addition, subtraction, multiplication and division)
- Oracle:decode function
- 【FPGA+GPS接收器】基于FPGA的双频GPS接收器详细设计介绍
- 疫情数据分析平台工作报告【3】网站部署
- [FPGA chaos] implementation of FPGA based chaotic system Verilog
- R语言使用survival包的coxph函数构建cox回归模型、使用ggrisk包的ggrisk函数可视化Cox回归的风险评分图(风险得分图)、并解读风险评分图、基于LIRI数据集(基因数据集)
- 怎样拥有心灵的平和?获得一颗全新的心灵
- Kill session? This cross domain authentication solution is really elegant!
- 动规(14)-三角形最佳路径问题
猜你喜欢

魏武帝 太祖知不可匡正,遂不复献言

【FPGA混沌】基于FPGA的混沌系统verilog实现

Drop down menu dropdown yyds dry inventory of semantic UI

Solution to missing in unity script

The memory four area model of C language program

The solution to the error "xxx.pri has modification time XXXX s in the futrue" in the compilation of domestic Kirin QT

Zabbix6.0新功能Geomap 地图标记 你会用吗?

19. Optimized database query of tornado project

智能面板WiFi聯動技術,ESP32無線芯片模組,物聯網WiFi通信應用

Ebpf series learning (4) learn about libbpf, co-re (compile once – run everywhere) | use go to develop ebpf programs (cloud native tool cilium ebpf)
随机推荐
Goodbye to excel and PPT, I found a better visual fool software
DS18B20数字温度计 (一) 电气特性, 供电和接线方式
疫情数据分析平台工作报告【7】阿里云相关
SQL safe backup display and zoom font support
R language uses the coxph function of survival package to build Cox regression model, uses the ggrisk function of ggrisk package to visualize the risk score map (risk score map) of Cox regression, and
无线物联网WiFi模块方案,ESP32-S3芯片技术,助力设备智能化
疫情数据分析平台工作报告【2】接口API
Kotlin 启动协程、launch 与async的区别、按照顺序启动协程
Esp32c3 remote serial port
Unity脚本出現missing時的解决方法
EN in Spacey_ core_ web_ SM installation problems
千字巨著《编程后传》
怎样拥有心灵的平和?获得一颗全新的心灵
Illustrating the use of Apache skywalking UI
spacy中en_core_web_sm安装问题
Epidemic data analysis platform work report [8.5] additional crawlers and drawings
Solution to missing in unity script
R语言plotly可视化:plotly可视化分组(grouped)小提琴图(grouped violin plot in R with plotly)
LINQ group by and select series - LINQ group by and select collection
Kinematic gauge (14) - Triangle optimal path problem