📌  相关文章
📜  javascript 检查对象数组中是否存在值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:24.511000             🧑  作者: Mango

代码示例4
addPerson = (person) => {
    let filteredPerson = this.state.likes.filter(like => like.name !== person.name);
    this.setState({
      likes: [...filteredPerson, person]
    })        
  }