title: How to compare each element in array to one single value?
body: <p>I have an <code>array</code> with multiple <code>objects</code> inside.
  It's structured like that:</p>
  
  <pre><code>const Instructor = [
    { ID: '141',
      InstructorNameAR: 'test',
      InstructorNameEN: 'Mohamed Ahmed',
      InstructorBriefAR: 'phd in chemistry',
      InstructorBriefEN: 'phd in chemistry' },
    { ID: '140',
      InstructorNameAR: 'test',
      InstructorNameEN: 'Mahmoud Ahmed',
      InstructorBriefAR: 'phd in chemistry',
      InstructorBriefEN: 'phd in chemistry' },
  ]
  </code></pre>
  
  <p>I wanted to add other <code>objects</code> but filtered of duplicates based on their <code>ID</code> values.</p>
  
  <p>Example of <code>objects</code> i want to add :-</p>
  
  <pre><code>  const InstructorInstance = {
      ID: 'ID',
      InstructorNameAR:   'NAMEAR',
      InstructorNameEN:   'NAMEEN',
      InstructorBriefAR:  'BRIEFAR',
      InstructorBriefEN : 'BRIEFEN'
    }
  </code></pre>
  
  <p>I used this method to filter by <code>ID</code>.
  But it didn't work as it compares only a <code>single</code> value of the <code>array</code> to the value i provided. which means it might be a <code>duplicated object</code> but still gets added because it did not check if it exists in each <code>array element</code></p>
  
  <pre><code>Instructor.forEach(instance =&gt;{
    if(instance.ID !== InstructorInstance.ID){
      Instructor.push(InstructorInstance);
    }else{
      console.log('Duplicate')
    }
  })
  </code></pre>