title: Replace array entry with spread syntax in one line of code?
body: <p>I'm replacing an item in a react state array by using the ... spread syntax. This works:</p>
  
  <pre><code>let newImages = [...this.state.images]
  newImages[4] = updatedImage
  this.setState({images:newImages})
  </code></pre>
  
  <p>Would it be possible to do this in one line of code? Something like this? (this doesn't work obviously...)</p>
  
  <pre><code>this.setState({images: [...this.state.images, [4]:updatedImage})
  </code></pre>