var dynamic_particle=function(){
this.init();
}
dynamic_particle.prototype={
init:function(){
this.a=new Array();
this.a.push(1);
alert(a[0]);
}
}
a出现错误为未定义
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你都知道前面用this.a ,alert的时候为何不加上
this.
呢……肯定报错封装方式,一般是这样使用的: