I want to overload the conversion of an object to a string, so that the following example would output the string "TEST" instead of "[object Object]". How do I do this?
function TestObj()
{
this.sValue = "TEST";
}
function Test()
{
var x = new TestObj();
document.write(x);
}