构造函数+原型

var Fn = function(){//定义一个构造函数


 };
Fn.prototype.fn = function(){console.log("fn")};//用原型prototype为Fn添加一个函数
var test = new Fn();//实例化
test.fn()

posted @ 2013-04-11 13:05  -恩恩-  阅读(117)  评论(0编辑  收藏  举报