title: minimal the function as short as it can be
body: <p>How do I make this Function as short as possible ?</p>
  <pre><code> function toggle(id){
          console.log(squares)
          setSquares(prevSquares =&gt; {
              const newSquares = [...prevSquares]
              newSquares[id-1].on = !newSquares[id-1].on;
              return newSquares;
          })
      }
  </code></pre>
  <p>I have tried to make it minimal and last function that wokred perfect is mentioned below</p>
  <pre><code>function toggle(id){
          setSquares(prevSquares =&gt; {prevSquares[id-1].on = !prevSquares[id-1].on
              return([...prevSquares])
           })
      }
  </code></pre>
  <p>I want to know if we can make it even small or not ?</p>