摘要:
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 ... 阅读全文
摘要:
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... 阅读全文