Question: I have 2 arrays: cars & bikes.
I want to compare each element of car array to all the other elements of bike array, If both are equal, then alert true else false.

```
$scope.getComparison = function() {
$scope.bikes = ["1", "3", "3", "2", "6", "55", "45", "36", "18"];
angular.forEach($scope.bikes, function(value, key) {
    $scope.p_Id = value.bikes;
    $scope.cars = ["1", "2", "3", "4", "54", "55", "56", "56", "58"];
    angular.forEach($scope.cars, function(value, key) {
        $scope.b_Id = value.cars;
        if ($scope.p_Id == $scope.b_Id) {
            alert(b_Id + "=" + p_Id + "=" + "true");
        } else {
            alert(b_Id + "=" + p_Id + "=" + "false");
        }
    });
  });
};

```

Where am I wrong ? I need help.

Answer: 
try this :

```
   $scope.bikes = ["1", "3", "3", "2", "6", "55", "45", "36", "18"];
   $scope.cars = ["1", "2", "3", "4", "54", "55", "56", "56", "58"];
   angular.forEach($scope.bikes, function(bike) {
      angular.forEach($scope.cars, function(car) {
        if (bike == car) {
          alert(bike + "=" + car + "=" + "true");
         } else {
             alert(bike  + "=" + car+ "=" + "false");
           }
     });
   });

```
Comparing **each** element of 1 array with **each** element of another array?

2 **each**'s means use 2 loops thats it.