假设以下是IIFE(立即调用的函数表达式)
(function (myfunction) {
myfunction(window.jQuery, window, document);
}(function ($, window, document) {
var dosum = function (a,b) {
return a+b;
};
var substractnum = function (a,b) {
return a-b;
};
}));
dosum(); //I want to call dosum() here out of its scope. How can this be achieve.
现在我想在其范围之外调用dosum()
。如何实现?