title: How to find equal objects in Javascript or Angularjs?
body: <p>I am facing a problem about object comparison.</p>
  
  <p>I have two objects list in javascript. How should i filter out the data if object properties is exactly same, then copy to new scope object. Any way to archive this if using <strong>AngularJs</strong>, <strong>Javascript</strong> or <strong>Underscorejs</strong> ? I already put into jsfiddle</p>
  
  <p><a href="http://jsfiddle.net/2wvazbxv/4/" rel="nofollow noreferrer">jsFiddle</a></p>
  
  <pre><code>var myApp = angular.module('myApp',[]);
  
  function MyCtrl($scope) {
    $scope.obj1 = [];
    $scope.obj2 = [];
    $scope.obj1.push({
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "22",
      style: null,
      discPer: 10
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "24",
      style: null,
      discPer: 20
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "80",
      style: null,
      discPer: 15
    });
  
    $scope.obj2.push({
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "81",
      style: null,
      discPer: 10
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "24",
      style: null,
      discPer: 20
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "80",
      style: null,
      discPer: 15
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "81",
      style: null,
      discPer: 8
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "83",
      style: null,
      discPer: 25
    },{
      buCode: "1000",
      deptCode: "1201",
      brandCode: null,
      prodType: 'C',
      cardType: "84",
      style: null,
      discPer: 30
    });
  
    console.log($scope.obj1);
    console.log($scope.obj2);
  }
  </code></pre>
  
  <p>I think use the underscoreJs is the best way to handle such as simple code syntax.
  First i use some method of underscorejs such as <strong>_.find</strong>, then handle the logic.</p>
  
  <pre><code>angular.forEach(obj1, function(v, k) {
      var isFind = _.find(obj2, function(o) {
          // some logic.
      })
  })
  </code></pre>