Here I have an array with many objects. In that I have a field as "id". I want only the id which has a value as null. How to pick it?
$scope.hierarchyList = response.data;
So how to pluck the value?
Here I have an array with many objects. In that I have a field as "id". I want only the id which has a value as null. How to pick it?
$scope.hierarchyList = response.data;
So how to pluck the value?
it's quite complicate to answer if there's no way to know the structure of response.data
. One way to do it (in case I understood) would be to:
var resultObj;
$scope.hierarchyList.forEach(function(hierarchy){
if(hierarchy.id === undefined){
resultObj = hierarchy;
}
})
please let me know if this is not the case or the question you're asking.