How to make many nested property objects quickly with less lines?
<p>so I'm using mongoDB for a migration project which takes queries as plain javascript/JSON:</p>

<pre><code>queryObj = {}; // our main object I pass to mongodb for queries
</code></pre>

<p>The below code throws error</p>

<pre><code>queryObj[inObj.row]['$eq'] = inObj.equals;
</code></pre>

<p>but this works....</p>

<pre><code>queryObj[inObj.row[i]] = {};
queryObj[inObj.row]['$eq'] = inObj.equals;
</code></pre>

<p>Is there a easy way to make a object with many nested properties sans having to define them as object? I could make a constructor function but I assuming their is an easy in-built solution via Object.create.</p>