var foo=(function myModule(){
var something="first module";
var another=[1,2,3];
function doSomething(){
console.log(something);
}
function doAnother(){
console.log(another.join("!"));
}
return {
doSomething:doSomething,
doAnother:doAnother
}
})();
foo.doSomething();//first module
foo.doAnother();//1!2!3
My first module
最新推荐文章于 2024-09-08 16:04:26 发布