当前位置:网站首页>严格模式,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)不允许函数参数重名
边栏推荐
- Disk and file system management
- What is Low-Code?What scenarios is low code suitable for?
- Short video seo search optimization main content
- 基于注意力机制的多特征融合人脸活体检测
- Multi-feature fusion face detection based on attention mechanism
- Constructor, this keyword, method overloading, local variables and member variables
- Microsoft PC Manager V2.1 beta version officially released
- bgp 聚合 反射器 联邦实验
- How does JSP use the page command to make the JSP file support Chinese encoding?
- When Netflix's NFTs Forget Web2 Business Security
猜你喜欢
随机推荐
CVPR 2022 | SharpContour:一种基于轮廓变形 实现高效准确实例分割的边缘细化方法
JSP out. The write () method has what function?
ROS dynamic parameters
JSP how to obtain the path information in the request object?
The Statement update Statement execution
[Solution] Emqx startup under win10 reports Unable to load emulator DLL, node.db_role = EMQX_NODE__DB_ROLE = core
After reshipment tencent greetings to monitor if the corresponding service does not exist by sc. Exe command to add services
146. LRU 缓存
How to find new potential projects?Tools recommended
How to use the go language standard library fmt package
Play NFT summer: this collection of tools is worth collecting
Unknown CMake command “add_action_files“
渗透测试与攻防对抗——渗透测试基础
思维导图,UML在线画图工具
JSP built-in object out object function introduction
NodeJs, all kinds of path
Redis-消息发布订阅
JSP Taglib指令具有什么功能呢?
Short video SEO search operation customer acquisition system function introduction
JSP request对象功能详解说明









