GitHub 博客园 Nanakon

better1【模式】Module模式

var myModule = (function($, _) {
    var privateVariable = "Hello World"
    var pulicProperty = "Foobar"

    function privateMethod() {

    }

    function pulicMethod = function() {

    }

    return {
        pulicProperty: pulicProperty,
        pulicMethod: pulicMethod
    }
})(jQuery, _);
 

 

posted on 2016-09-07 01:42  jzm17173  阅读(99)  评论(0编辑  收藏  举报

导航

轻音