| Refresh | Home EGTry.com

convert object to string, custom way to print object


commentsJavascript sourceExecution result in your current browser
built-in string representation of object
  var obj=new Object();
  document.write(obj);

overide toString()
   obj.toString=function() { return "my object"}
   document.write(obj);