I am working with two JSON objects.
$scope.car1={"Sedan":{"Audi":["A4","A3"]},"Hatchback":{"Maruthi":["Swift"]}};
$scope.car2={"Hatchback":{"Maruthi":["Swift"]},"Sedan":{"Audi":["A3","A4"]}};
I have attempted to compare these two objects using the code below:
var a=angular.equals($scope.car1,$scope.car2);
Although angular.equals
provides a deep comparison, it takes into consideration the order of data as well. I am looking for a method to compare objects without considering the order. Is there any other way to achieve this?