javascript设计模式(1)——面向对象基础

用对象收编变量2种方式函数

1 函数式this

var Object = {prototype

   name:function(){ return this; },对象

   email:function(){ return this; }io

}function

Object.name().email();email

2 类式变量

var Object = function(){};mail

Object.prototype = {return

   name:function(){ return this; },

   email:function(){ return this; }

}

相关文章
相关标签/搜索