摘要: 1.类数组对象 a.定义 let arrayLike = { 0: 'name', 1: 'age', 2: 'sex', length: 3 } b.调用数组方法 Array.prototype.join.call(arrayLike , '&') Array.prototype.slice.ca 阅读全文
posted @ 2018-11-08 15:37 胖糖糖爱吃肉 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 1.闭包 a.即使创建它的上下文已经销毁,它依然存在; b.在代码中引用了自由变量(自由变量是指在函数中使用的,但既不是函数参数也不是函数的局部变量的变量)。 2.call和apply的模拟实现 Function.prototype.call = function (context) { conte 阅读全文
posted @ 2018-11-08 14:48 胖糖糖爱吃肉 阅读(181) 评论(0) 推荐(0) 编辑