Same element is more than one time then it will return true otherwise it will be false

If the same element is more than one time then it will return true otherwise it will be false.
and push the return value data in output.

var array = [
  { id: 1, value: 10 },
  { id: 2, value: 10 },
  { id: 3, value: 10 },
  { id: 4, value: 56 },
  { id: 5, value: 56 }
]

Output will be like this

var output = [
  { id: 1, value: 10, matched: true },
  { id: 2, value: 10, matched: false },
  { id: 3, value: 10, matched: false },
  { id: 4, value: 56, matched: true },
  { id: 5, value: 56, matched: false }
]