SOURCE

var CustomerModule1=(function () {
    var name = "Rico";
    var age = 27;
    return {
        say: function() {
            console.log("My name is " + name, "My age is " + age);
        }
    }
})();
CustomerModule1.say();

(function (window) {
    var name = "ZR";
    var age = 17;
    var say = function() {
            console.log("My name is " + name, "My age is " + age);
        }
    window.CustomerModule2 = {say}
})(window);
CustomerModule2.say();

//闭包 作用域  函数自执行 

console 命令行工具 X clear

                    
>
console