title: Is there an __repr__ equivalent for javascript?
body: <p>The closest I got to something close to Python's <strong>repr</strong> is this:</p>
  
  <pre><code>function User(name, password){
           this.name = name;
           this.password = password;
  }
  User.prototype.toString = function(){
      return this.name;
  };
  
  
  
  var user = new User('example', 'password');
  
  console.log(user.toString()) // but user.name would be even shorter
  </code></pre>
  
  <p><em>Is there a way to represent an <code>object</code> as a string by default? Or am I going to have to just use <code>object.variable</code> to get the results I want?</em></p>