Check if an object in an array is exist in another array, then change the value of that another array in Javascript

  javascript

i have an array A

const arrayA = [
          {
            id:a,
            check:false
          },
          {
            id:b,
            check:false
          },
          {
            id:c,
            check:false
          } 

and an array B

const arrayB = [
  {
    id:a,
  },
  {
    id:b,  
  }
]

and i want to check if arrayB is exist arrayA by id, then change check to true. Using lodash or js array methods

Source: Ask Javascript Questions

LEAVE A COMMENT