title: Assign a const variable inside a map function
body: <p>I'm using Reactivesearch, and I'm trying to assign a const variable inside a map function. Specifically in the <code>.map</code> Like such:</p>
  
  <pre><code>onAllData(data, streamData) {
  
      return (
          &lt;div className="grid"&gt;
          {
              data.map((item) =&gt; 
                  const propertyName = item.productName;
  
                  &lt;div className="flex-container card" key={item._id}&gt;
                      &lt;div className="content"&gt;
                          &lt;p&gt;{propertyName}&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              )
          }
      );
  }
  </code></pre>
  
  <p><code>const propertyName = item.productName;</code> is giving me problem. <code>Error states unexpected token</code> .</p>
  
  <p>Is it possible?</p>