How to create object inside object in JS : <p>I want to create an object inside an object in JavaScript like this:</p>

<pre><code>    {
      "test": {
        {},
        {}
      }
    }
</code></pre>

<p>In more detail, I want to create a new object if "test" doesn't exist in the object, and create a new object in the same location as the old one if "test" exists.</p>

<p>Please help if this is possible.</p>
