当前位置:网站首页>严格模式,use strict
严格模式,use strict
2022-08-02 00:14:00 【weixin_46051260】
使用严格模式,不会支持一些不规范的语法
1)调试更容易
2)变量在赋值之前必须要声明,防止意外的全局变量
function fun(){
a=10
}
fun()
console.log(a);//会造成内存泄漏
3)取消this的强制转换
var age=10
function fun(){
console.log(this.age);
}
fun.apply(null)
引用null或者未定义的值,this值会自动强制到全局变量,严格模式下会抛出错误,this不会指向全局变量
4)不允许函数参数重名
边栏推荐
- Pytorch seq2seq 模型架构实现英译法任务
- els block deformation judgment.
- JSP out.print()和out.write()方法的不同之处
- Transient Stability Distributed Control of Power System with External Energy Storage
- Using the "stack" fast computing -- reverse polish expression
- 协作乐高 All In One:DAO工具大全
- An overview of the most useful DeFi tools
- MLX90640 红外热成像仪测温传感器模块开发笔记(十) 成果展示-红眼睛相机
- 回顾历史5次经济衰退时期:这一次可能会有何不同?
- Unknown CMake command "add_action_files"
猜你喜欢

BGP 第一次实验

An overview of the most useful DeFi tools

IP Core: FIFO

Play NFT summer: this collection of tools is worth collecting
![[HCIP] BGP Small Experiment (Federation, Optimization)](/img/a2/0967200c69cff3b683dc0af6f314c8.png)
[HCIP] BGP Small Experiment (Federation, Optimization)

回顾历史5次经济衰退时期:这一次可能会有何不同?

BGP综合实验 建立对等体、路由反射器、联邦、路由宣告及聚合

PHP从txt文件中读取数据的方法

Short video SEO optimization tutorial Self-media SEO optimization skills and methods

Automatic conversion of Oracle-style implicit joins to ANSI JOINs using jOOQ
随机推荐
2022/08/01 Study Notes (day21) Generics and Enums
Knowing the inorder traversal of the array and the preorder traversal of the array, return the postorder history array
青蛙跳台阶
Active Disturbance Rejection Control of Substation Inspection Robot Based on Data Drive
Identify memory functions memset, memcmp, memmove, and memcpy
What is it like to trade for a living?
JSP how to obtain the path information in the request object?
[HCIP] BGP Small Experiment (Federation, Optimization)
Looking back at 5 recessionary times in history: How might this time be different?
MLX90640 红外热成像仪测温模块开发笔记(完整版)
els block deformation
els strip deformation
An Enhanced Model for Attack Detection of Industrial Cyber-Physical Systems
Unknown CMake command "add_action_files"
Play NFT summer: this collection of tools is worth collecting
当奈飞的NFT忘记了Web2的业务安全
Redis - message publish and subscribe
基于超参数自动寻优的工控网络入侵检测
测试点等同于测试用例吗
Redis-消息发布订阅