摘要: 闭包特征: a.函数作为参数传递 b.函数作为返回值 闭包的自由变量查找是在函数定义的地方向上级作用域查找,而不是执行的地方 this是在函数执行的地方查找,而不是定义的地方,他俩正好相反 this五种情况:普通函数;call,apply,bind;对象方法;类;箭头函数 箭头函数this的取值是取 阅读全文
posted @ 2021-12-19 16:07 superil 阅读(30) 评论(0) 推荐(0) 编辑
摘要: arr = [1,2,3] 1.ES5 Array.isArray(arr); //true 2.instanceof arr instanceof Array; // true 3.Object.prototype.toString.call(arr) '[object Array]' //tru 阅读全文
posted @ 2021-12-19 13:05 superil 阅读(25) 评论(0) 推荐(0) 编辑
摘要: []+{} // '[object Object]' {}+[] // 0 []+1 // '1' {}+1 // 1 ({})+1 // '[object Object]1' [].valueOf()➡️ [], [].toString()➡️'' {}放在开头会当成代码块,{}+1 {}+[]相 阅读全文
posted @ 2021-12-19 12:50 superil 阅读(48) 评论(0) 推荐(0) 编辑