I am new to javascript and I have written a code like this
file myclass.js
//----------------------------------------------
function myclass () {
this.functionA = function (value) {
var _this = this;
_this.functionB ();
}
this.functionB = function () {
// here I am using the value passed to functionA when it is called.
alert(value);
}
}
//------------------------------------------------------------------
file main.js
//-----------------------------------------
mc = new myclass();
mc.functionA (45);
//-------------------------------------
Here I am totally confused that I am my main file I have called a functionA passed an argument and When I have called functionB in functionA I haven't passed the argument in functionB but still I am able to access it. Can any one kindly explain that how is it possible ??
P.S value is not global and not used any where else
Thanks