title: Check whether an object with property value 'x' exists in an array in Javascript
body: <p>I have a lot of objects that I'm trying to filter out duplicates from. When an object has a property, <code>IMAGEURL</code> which is present in another object, I want to ignore this object and move on.</p>
  
  <p>I'm using <code>nodeJS</code> for this so if there's a library I can use to make it easier let me know.</p>
  
  <p>I've done similar implementations before with checking string values in arrays, doing something like:</p>
  
  <pre><code>var arr = ['foo', 'bar'];
  if(arr.indexOf('foo') == -1){
     arr.push('foo')
  }
  </code></pre>
  
  <p>But this won't work for objects, as best I can tell. What are my options here? To put it more simply:</p>
  
  <pre><code>var obj1 = {IMAGEURL: 'http://whatever.com/1'};
  var obj2 = {IMAGEURL: 'http://whatever.com/2'};
  var obj3 = {IMAGEURL: 'http://whatever.com/1'};
  
  var arr = [obj1, obj2, obj3];
  var uniqueArr = [];
  
  for (var i = 0; i&lt;arr.length; i++){
      // For all the iterations of 'uniqueArr', if uniqueArr[interation].IMAGEURL == arr[i].IMAGEURL, don't add arr[i] to uniqueArr
  }
  </code></pre>
  
  <p>How can I do this?</p>