constobj={name:"jsCoder",skill:["es6","react","angular"],say:function(){for(vari=0,len=this.skill.length;isetTimeout(function(){ console.log(i);console.log(this.skill[i]);}(i),0)console.log(i);}}};obj.say();改成settimeout中可以正常顺序打印i和依次打印skill,大家都懂的,有哪些方法,各位发挥
四季花海
慕尼黑的夜晚无繁华
相关分类