+ 3
In JavaScript, can you create a method inside a method and call it independently of the parent method.
if so what is the need for that, i didn't even grab the idea of recursion talkless of this concept. urghhhh
2 Answers
+ 3
I think it's possible. As long as the child method was not called.
+ 2
this is the basic structure of the module pattern which goes something like this
function MyModule(){
function myMethod(n){//code}
return{myMethod:myMethod}
}
// call myMethod
MyModule.myMethod(4);
this gives you access to member functions, cant call myMethod without the MyModule