How can i change the value of a variant that defined in a function for ever?
Is any solution for return the new value of 'data' variable that replaced using change() function.
Code:
function test()
{
this.data = 'hello';
}
function change()
{
var a = new test();
a.data = 'hi';
alert(a.data);
}
change(); // return hi
var b = new test();
alert(b.data); // return hello
Comment