var object = {}; // Global Object
(function() {
var theArg, google, yahoo;
object.google = function(arg) {
theArg = arg;
alert(theArg);
}
object.yahoo = function() {
alert(theArg);
}
module.exports = yahoo;
})();
// This will set initial value of
google("Hello World");
我可以这样称呼吗module.exports = yahoo
?yahoo
并在其他地方调用该函数。