JavaScript React Components Managing State and Data Flow Update State Based on a Player's Index

setState with "+=" instead of just "+"

Hello everyone,

I don't really understand why we are using "+=" instead of just "+" at 2:20?

Works:

 handleScoreChange = (index, delta) => {
    this.setState(prevState => ({
      score: (prevState.players[index].score += delta),
    }));
  };

Doesn’t work:

 handleScoreChange = (index, delta) => {
    this.setState(prevState => ({
      score: (prevState.players[index].score + delta),
    }));
  };

Before we reworked this function to be for both(increment and decrement), we were updating the state with just "+" or "-" like so:

incrementScore = () => { 
  this.setState(prevState => ({
     score: prevState.score + 1 
}));
}

decrementScore = () => { 
  this.setState(prevState => ({
     score: prevState.score - 1 
}));
}

We were not doing something like score: prevState.score += 1 or score: prevState.score -= 1. Could you please explain what has changed here?