var obj = new Object(); obj.a = 3; obj.b = 4; obj.fun = function() { return this.a + this.b; }; alert("The Answer is " + obj.fun());
Click on code to see alert aswer.