为什么如本article中所述,代码段1比代码段2更有效?
//snippet 1
handleClick() {
this.setState(state => ({
words: state.words.concat(['marklar'])
}));
}
//snippet 2
handleClick() {
const words = this.state.words;
words.push('marklar');
this.setState({words: words});
}