this用法的问题
function Car(color){
this.color = color;
}
var new_car= new Car( "1 ");
alert(new_car.color);
为什么属性就可以
方法就不可以呢
function Car(){
this.dd() = function(){alert( '33 ');};
}
var new_car= new Car();
new_car.dd();
------解决方案--------------------
this.dd() = function(){alert( '33 ');};
---> > >
this.dd = function(){alert( '33 ');};
------解决方案--------------------
this.add = function(){
alert( "kendo ") ;
}
查询谷 - www.chaxungu.com
this用法的有关问题
编辑:chaxungu时间:2022-10-02 23:23:11分类:web开发