摘要: arguments是一个类似于数组的对象。当函数调用后,会传入参数,这些参数就是保存在arguments中。 //定义一个函数并在调用时传了两个参数,在函数中输出(注意它只能在函数里面使用) function a(num1, num2){ console.log(arguments); } a(1, 阅读全文
posted @ 2020-06-21 01:43 是桂 阅读(284) 评论(0) 推荐(0) 编辑
摘要: Q:为什么用普通函数时,setTimeout里面的this指向的是window? //通过保留this的方式,通过闭包的特性去拿this let _this = this //...ajax setTimeout(function(){ _this.age = 14; //console.log(t 阅读全文
posted @ 2020-06-21 00:39 是桂 阅读(117) 评论(0) 推荐(0) 编辑