您现在的位置是:首页 > 电脑技术查询 > web开发

prototype的有关问题

编辑:chaxungu时间:2022-10-02 23:22:45分类:web开发

prototype的问题
var f = function() { this.i() };
f.prototype.i = function() { alert( 'd '); };

var dd = new f();

为什么f.prototype.i明明在this.i()后面
却能执行

------解决方案--------------------
因为var dd = new f();在最后面~~~