我有一些像下面的代碼。Chrome控制檯中'[Object]'和'[object Object]'的區別?
MyRequests.cors_request("POST",
APP_CONFIG.APP_URL+"https://stackoverflow.com/users/selectAllUsers",
null,
function ok(users) {
$scope.usersNotFiltered = users;
console.log('users--->', users);
console.log('$scope.userPerSystem--->', $scope.userPerSystem);
// delete the items that is already exists in the userPerSystem
function filterUsers(element, index, array) {
console.log("$scope.usersNotFiltered :: " + users);
commonFindAndRemove($scope.usersNotFiltered, 'userId', element.userId);
console.log('a[' + index + '] = ' + element.userId);
}
$scope.userPerSystem.forEach(filterUsers);
$scope.users = $scope.usersNotFiltered;
},
我運行tihs代碼並觀看控制檯。在Chrome控制檯中'[Object]'和'[object Object]'有什麼區別?
用戶---> [對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象,對象]
$ scope.userPerSystem ---> [Object] 0:Objectlength:1__proto__:Array [0] redca-ias.concat.js:5258
$ scope.usersNotFiltered :: [object Object],[object Object] ,[object object],[object object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] ,[object object],[object object],[object object],[object Object],[object Object],[object Object]
是什麼使它有所不同? $ scope.usersNotFiltered和用戶是同一類型的值,我從$ http回調返回值。 – verystrongjoe