title: Expected an assignment or function call and instead saw an expression error in react if return is not present inside map statement why?
body: <pre><code>import React, { Component } from 'react'
  
  export default class DisplayTodo extends Component {
      state = {
          todo:["eat", "sleep", "repet"]
      }
      render() {
          return (
              &lt;div&gt;
              {
                  this.state.todo.map((value)=&gt;{
                      &lt;p&gt;{value}&lt;/p&gt;
                  })
              }
              &lt;/div&gt;
          )
      }
  }
  </code></pre>
  
  <p>1) <strong>I know if i keep return in map</strong> it works  but i want know why it failed </p>
  
  <p>2)Moreover i referd to the link in for React </p>
  
  <blockquote>
    <p><a href="https://reactjs.org/docs/introducing-jsx.html#embedding-expressions-in-jsx" rel="nofollow noreferrer">https://reactjs.org/docs/introducing-jsx.html#embedding-expressions-in-jsx</a></p>
  </blockquote>
  
  <p>Now the error looks quit opposite to the explanition saying Expected an assignment or function call and instead saw an expression </p>
  
  <p>3)in the react link explanation in above  it is said You can put any valid JavaScript expression inside the curly braces </p>
  
  <p>4) Moreover in javascript we can write like this why it is not possible in React </p>
  
  <pre><code>var a = [11,33,99]
  a.map((val)=&gt;{
  console.log(val*2)
  })
  </code></pre>