Javascript Object to_s()

Description

Javascript Object to_s()


Object.prototype.to_s = function () {
  try {/*from w  ww .ja v  a 2  s  .  c  om*/
    return JSON.stringify(this.valueOf());
  } catch (ex) {
    return this.valueOf().toString();
  }
};



PreviousNext

Related