title: which of these two methods are better to manipulate state?
body: <p>When changing State in React which one of these would be the preferred way ( or is there no preferred way ) </p>
  
  <p>1)</p>
  
  <pre><code>handleDeleteOption(optionToRemove){
  
  this.setState((prevState)=&gt;({
  options: prevState.options.filter((option)=&gt;{
    return optionToRemove !== option    })
  }))
  }
  </code></pre>
  
  <p>or</p>
  
  <p>2)</p>
  
  <pre><code>handleDeleteOption(option){
  
  this.setState((prevState)=&gt;{
    const newArray = [...prevState.options]
    newArray.splice(newArray.indexOf(option), 1) 
    return{
      options: newArray
    }
  })
  }
  </code></pre>
  
  <p>thank you !</p>