text: Q:
  
  Javascript Object with default value
  
  What I want to achieve seems quite simple but I'm not sure if it's possible.
  I'd like to have an object that returns a certain value if no property is specified. For example:
  console.log(obj) // Returns "123"
  console.log(obj.x) // Returns "ABC"
  
  A:
  
  Override the toString() method in the prototype for your custom object.
  function MyObj() {
  }
  MyObj.prototype.toString = function () {
      return '123';
  };
  var obj = new MyObj();
  obj.x = 'ABC';
  console.log(obj + '');
  console.log(obj.x + '');
  
  