Comparing attributes from two arrays of objects

PHOTO EMBED

Wed Jun 07 2023 21:18:23 GMT+0000 (Coordinated Universal Time)

Saved by @gbritgs

this.array1.forEach((obj1) => {
  const matchingObject = array2.find(
    (obj2) => obj1.code === obj2.code
  );

  if (matchingObject) {
    obj1.disableCheckbox = false;
  } else {
    obj1.disableCheckbox = true;
  }
});
content_copyCOPY