I have a functions A
B
with same method in them. I want to access this method from another function. Depends upon some condition ill choose any one of version!
function A() {
var method = function() {
// do something..
}
}
function B() {
var method = function() {
// do something..
}
}
function other() {
// access method from function A() or B();
}
is there any way to access using objects like we do in JAVA or any other way?