title: What's the square brackets for when definining an object?
body: <p>I noticed somewhere that we could define an object using the following syntax:</p>
  <pre class="lang-js prettyprint-override"><code>const a = {
    [&quot;test&quot;]: 1,
    [&quot;tmp&quot;]: 2,
  };
  </code></pre>
  <p>Is it the same as the following one?</p>
  <pre class="lang-js prettyprint-override"><code>const b = {
    &quot;test&quot;: 1,
    &quot;tmp&quot;: 2,
  };
  </code></pre>
  <p>If so, what's the <code>[]</code> for in the first code block?</p>