title: Property assignment expected when using template literals to create an Object
body: <p>I am trying to create an object inside a JSON object that will be later populated from FormData:</p>
  <pre class="lang-js prettyprint-override"><code>function toJSONstring(form) {
  
    let object = {`&quot;${form.name}&quot;: {}`}; //Property assignment expected.ts(1136)
  
    let formData = new FormData(form);
    formData.forEach((value, key) =&gt; {
      // Reflect.has in favor of: object.hasOwnProperty(key)
      if (!Reflect.has(object, key)) {
        object[key] = value;
        return;
      }
      if (!Array.isArray(object[key])) {
        object[key] = [object[key]];
      }
      object[key].push(value);
    });
    form.reset();
    return JSON.stringify(object);
  }
  </code></pre>
  <p><strong>What I want to obtain is the following JSON:</strong></p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;network_settings&quot;: {
          &quot;connection&quot;: &quot;wifi&quot;,
          &quot;type&quot;: &quot;dhcp&quot;,
          &quot;ssid&quot;: &quot;Jorj_2.4&quot;,
          &quot;ip_address&quot;: &quot;&quot;,
          &quot;gateway&quot;: &quot;&quot;,
          &quot;subnet&quot;: &quot;&quot;,
          &quot;dns&quot;: &quot;&quot;
      }
  }
  </code></pre>
  <p>but I get <code>Property assignment expected.ts(1136)</code>.</p>
  <p>If I replace</p>
  <pre><code>let object = {`&quot;${form.name}&quot;: {}`};
  </code></pre>
  <p>with <code>let object = {};</code> then I get a normal JSON object:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;connection&quot;: &quot;wifi&quot;,
      &quot;type&quot;: &quot;dhcp&quot;,
      &quot;ssid&quot;: &quot;Jorj_2.4&quot;,
      &quot;ip_address&quot;: &quot;&quot;,
      &quot;gateway&quot;: &quot;&quot;,
      &quot;subnet&quot;: &quot;&quot;,
      &quot;dns&quot;: &quot;&quot;
  }
  </code></pre>
  <p>How can I created the nested object that I want ?</p>