假如有兩個數組,怎樣把兩個數組的差集push進$scope.dataIndex這個數組啊如果不引入其他第三方庫的情況下,如何用js 得到差集呢 let tempData = [5, 6, 8]; let tempArr = [5, 6, 7, 8]; $scope.dataIndex = []; angular.forEach(tempData, function(item, index) { //if (tempArr.indexOf(item.Id) !== -1) { // $scope.dataIndex.push(item.Id); // console.log(item); // } });
angular 求兩個數組的差集
瀟瀟雨雨
2019-02-21 17:18:00