Hi...i'm still new at this js oo..what i would to do is return value from a one class method to the other..as you all can see below i have 2 simple class which is MyMath and MathResult..the problem is how can i return the value of this.DoMath() which is this.total in MyMath to this.ShowMathResult in MathResult..thanking you all in advance for reviewing my post function MyMath(){ this.StartMath = function(a,b,c){ this.a = a; this.b = b; this.c = c; this.DoMath(); }; this.DoMath() = function(){ this.total = this.a +this. b - this.c; return this.total; }; } function MathResult(){ this.ShowMathResult = function(){ alert(this.total); } } Code (markup):
Hi, try this code: var mm = new MyMath(); mm.StartMath(1,5,3); var mr = new MathResult(); mr.ShowMathResult.call(mm); Code (markup): and remove return line from DoMath function definition and breckects after DoMath function name, like below: this.DoMath = function(){ this.total = this.a +this. b - this.c; }; Code (markup): -- Mariush