标题不知该如何表达(⊙﹏⊙)数组莫名变这么多位handleStrip1: function(strip,num) { var i = 0, self = this , len = strip.length; strip.push(self.duration) //在这添加的 if(!(len>0))return; for (i; i < len; i++) { console.log("当前的sum = "+strip[i]); if(strip[i]>num){ return +i; } } }handleStrip1函数(被setInterval方法每50毫秒调用),第一个参数strip传的的是这个对象的属性,匿名函数中的变量不是函数运行结束后就销毁了吗,为什么会影响到这个对象的属性呢?function AA() { this.strip = data;}AA.prototype = { init : function() { var self = this; self.timer = setInterval(self.run.bind(self), 50); }, run : function() { var self = this; self.curStrip = self.handleStrip1(self.strip,(self.Audio.currentTime).toFixed(2)); }};
添加回答
举报
0/150
提交
取消