JS中裝飾器模式的實現

var tree = {}; tree.decorate = function() { alert('Make sure the tree won\'t fall'); }; tree.getDecorator = function(deco){ tree[deco].prototype = this; return new tree[deco]; }; tree.RedBalls = funct
相關文章
相關標籤/搜索