当前位置:网站首页>严格模式,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)不允许函数参数重名
边栏推荐
- An interesting project--Folder comparison tool (1)
- JSP如何使用request获取当前访问者的真实IP呢?
- 基于数据驱动的变电站巡检机器人自抗扰控制
- [Headline] Written test questions - minimum stack
- Looking back at 5 recessionary times in history: How might this time be different?
- go笔记之——goroutine
- 众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散
- MLX90640 红外热成像仪测温模块开发笔记(完整版)
- Statement执行update语句
- CVPR 2022 | SharpContour:一种基于轮廓变形 实现高效准确实例分割的边缘细化方法
猜你喜欢

Quick solution for infix to suffix and prefix expressions

These 4 computer notepad software, you have to try

Double queue implementation stack?Dual stack implementation queue?

632. 最小区间

bgp aggregation reflector federation experiment

路由策略

当奈飞的NFT忘记了Web2的业务安全

使用jOOQ将Oracle风格的隐式连接自动转换为ANSI JOIN
![[Headline] Written test questions - minimum stack](/img/67/08f2be8afc780e3848371a1b5e04db.png)
[Headline] Written test questions - minimum stack

众筹DAO“枯萎”的缩影:曾拍下《沙丘》未出版手稿的Spice DAO解散
随机推荐
bgp aggregation reflector federation experiment
具有通信时延的多自主体系统时变参考输入的平均一致性跟踪
信息物理系统状态估计与传感器攻击检测
An overview of the most useful DeFi tools
ROS dynamic parameters
不要用jOOQ串联字符串
632. 最小区间
Short video seo search optimization main content
MYSQL(基本篇)——一篇文章带你走进MYSQL的奇妙世界
go笔记——map
Short video SEO search operation customer acquisition system function introduction
Multi-feature fusion face detection based on attention mechanism
Unknown CMake command “add_action_files“
What is it like to trade for a living?
swing的Jlist列表滚动条以及增加元素的问题
The Statement update Statement execution
测试点等同于测试用例吗
After reshipment tencent greetings to monitor if the corresponding service does not exist by sc. Exe command to add services
Trie详解
Active Disturbance Rejection Control of Substation Inspection Robot Based on Data Drive