摘要: 1 var mammal = function(spec) { 2 var that = {}; 3 4 that.get_name = function() { 5 return spec.name; 6 }; 7 8 that.says = function() { 9 return spec.saying || '';10 };11 return that;12 };13 14 var myMammal = mammal({15 ... 阅读全文
posted @ 2012-07-13 14:44 小猩猩君 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 var mammal = function(spec) { 2 var that = {}; 3 4 that.saying = function() { 5 return spec.saying; 6 }; 7 8 that.get_name = function() { 9 return spec.name;10 };11 12 that.says = function() {13 return this.sayi... 阅读全文
posted @ 2012-07-13 10:26 小猩猩君 阅读(161) 评论(0) 推荐(0) 编辑