title: Creating an element using .map function in Javascript
body: <p>I'm struggling while creating an element that is passed by the <code>.map</code> function. Basically, I want my webpage to create a div element with some date in it when a button is clicked for that I'm using a <code>.map</code> function but it isn't working out.</p>
  <pre><code>const handleSubmit = (e) =&gt; {
          e.preventDefault();
          const data = {title:`${title}`, desc:`${desc}`, date:`${date}`};
          data.map(userinfo =&gt;{
              return(&lt;div&gt;
                  &lt;h1&gt;{userinfo.title}&lt;/h1&gt;
              &lt;/div&gt;)
          })
          console.log(data);
      }
  </code></pre>