title: why using { } in map() method is returning undefined array?
body: <p>an object array</p>
  <pre><code>const menu = [
    {
      name: &quot;pancakes&quot;,
      category: &quot;breakfast&quot;,
    },
    {
      name: &quot;burger&quot;,
      category: &quot;lunch&quot;,
    },
    {
      name: &quot;steak&quot;,
      category: &quot;breakfast&quot;,
    },
    {
      name: &quot;bacon&quot;,
      category: &quot;breakfast&quot;,
    },
  ];
  </code></pre>
  <p>this is returning an undefine array but when curly braces removed it's working fine.</p>
  <pre><code>const categories = menu.map((item)=&gt;{item.category});
  console.log(categories);
  </code></pre>