var SomeName = function() {
var function1 = function (number) {
return number+1;
}
var anotherFunction = function (number) {
return number+2;
}
return {
function1: function (number) {
return function1(number);
},
function2: function (number) {
return anotherFunction(number);
}
}
}();
...............
Console.log(SomeName.function1(1)); //logs 2 console.log(SomeName.function2(1)); //logs 3
Comments
Post a Comment