prototype原型的用法

//对象字面量写法 var fn = { name: 'hello world', fn1: function() { console.log(this.name); } }; fn.fn1(); //prototype原型写法 function Fn() { this.name = 'hello world'; this.fn1 = f...
posted @ 2017-07-22 15:16  鱿鱼须须  阅读(275)  评论(0编辑  收藏  举报