Here is a JavaScript function I have:
function status(){
this.functionA = function(){}
//Other functions and fields go here
}
Now, there is another function as well:
function create(root){
var server = library(function (port) {
//Additional functions here
});
var returnValue = {
current:status(),
cur:function(port){
current.functionA();
}}
return returnValue;
}
Whenever I try to call current.functionA()
, it shows an error saying that current is undefined. How can I successfully call functionA()
?