0
這是什麼問題?我想調用一個字符串作爲函數。可能有人請幫助我在此在javascript中調用字符串作爲函數調用
var wnameSpace = (function(){
var privateVar = '';
privateVar = "dummyFunction";
dummyFunction = function(){
console.log("hurray dummyFunction called here");
};
return {
publicFunction:function() {
console.log(window[wnameSpace])
}
}
})();
wnameSpace.publicFunction();