Changing the value of an array of objects based on another array in javascript

后端 未结 0 1378
猫巷女王i
猫巷女王i 2020-12-05 18:04

I have two arrays.

let arr1 = [{id: 1, favorite: false}, {id: 2, favorite: false}, {id: 3, favorite: false}];
let arr2 = [1, 3];

If the id ex

相关标签:
回答
  • 消灭零回复
提交回复
热议问题