Search

10/30/2009

closure


YAHOO = {};
YAHOO.BasePanel = (function (id, config) {
var panel;

return {
build: function () {
if (panel) {
console.log('panel!');
}

panel = {'hello':'world'}
}
}
})();
YAHOO.BasePanel.build();
YAHOO.BasePanel.build();

沒有留言: