有没有办法返回 angularjs 范围内存在的两个数组之间的差异
例如,
$scope.user1 = ['a', 'b'];
$scope.user2 = ['a', 'b', 'c', 'd'];
这两者的区别应该给我另一个
$scope.user3= ['c','d']
Underscore.js对此有不同的方法。
http://underscorejs.org/#difference http://underscorejs.org/#difference
$scope.user1 = ['a', 'b'];
$scope.user2 = ['a', 'b', 'c', 'd'];
$scope.user3 = _.difference($scope.user2, $scope.user1);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)