The closest I got to something close to Python\'s repr is this:
function User(name, password){
this.name = name;
this.pass
This is solution for NodeJS (not sure about browser). As https://nodejs.org/dist/latest-v8.x/docs/api/util.html#util_util_inspect_object_options says, you could add inspect(depth, opts) to your class and it will be called when you console.log(user_class_instance);
Therefore this should do the trick:
User.prototype.inspect = function(depth, opts){
return this.name;
};