2021年8月9日

ES6

摘要: ##let与var let不可以重复申明变量,但是var可以 let有块级作用域,var没有 { let name = "LLC"; } 在{}外部是拿不到name的 let不存在变量提升 let不影响作用域链 { console.log(sex); //undifined let name = " 阅读全文

posted @ 2021-08-09 22:36 In-6026 阅读(34) 评论(0) 推荐(0)

this指向

摘要: ##在函数调用中(指向window) function demo() { console.log(this); } demo(); //window ##在对象调用函数中(指向调用这个函数的对象) let Obj = { name: "LLC", say: function() { console. 阅读全文

posted @ 2021-08-09 01:57 In-6026 阅读(39) 评论(0) 推荐(0)

导航