title: How to check that object with same ID (or any other attribute ) exists in array of objects?
body: <p>I have following array:</p>
  
  <pre><code>var array = [
                  {
                      "milestoneTemplate": {
                          "id": "1",
                          "name": "TEST1"
                      },
                      "id": "1",
                      "date": "1416680824",
                      "type": "ETA",
                      "note": "Note",
                      "color": "66FF33"
                  },
                  {
                      "milestoneTemplate": {
                          "id": "2",
                          "name": "Test 2"
                      },
                      "id": "2",
                      "date": "1416680824",
                      "type": "ATA",
                      "note": "Note 22",
                      "color": "66FF00"
                  }
              ];
  </code></pre>
  
  <p>And now i would like to check in forEach loop that object (which is passed in param of the function) is existing in array by his ID.</p>
  
  <p>In case that not = do push into existing array.</p>
  
  <pre><code>arrayOfResults.forEach(function(entry) {
                  if(entry != existingInArrayByHisId) {
                  array.push(entry);
  }
          });
  </code></pre>
  
  <p>Thanks for any advice</p>