'Console.log does not display all property values of my object?

Is this expected behavior that is documented some where or is this an error / glitch? Here is the code:

  console.log(typeof myURL);  // is type object
  console.log(myURL);         // does not have a property of type name
  console.log(myURL.name);    // verified name exists on the object

I found this bizarre. Here is the preceding code for above:

  let myURL = new URL(url);
  myURL.name = myURL.hostname.replace(/\./g, '_');

I have documented the behavior but want to know if this is expected or a "glitch".



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source