Purpose: I need to call sub function within main one;
Function declaration:
var MainFunction = function () {
function NestedFunc1(){
console.warn("NestedFunc1");
};
function NestedFunc2(){
console.warn("NestedFunc2");
};
}
Functions call:
MainFunction.NestedFunc1();
MainFunction.NestedFunc2();
- What am I doing wrong?
10x;
MainFunctionto do something itself, or just be a sort of container? PS. Functions don't end in semi-colons; if you put one there, it just creates an empty statement;