I have an JSONarray which looks like this,
{
"TotalMemory": [{
"key": "TotalMemory",
"values": [
[118, 10]
]
}],
"Freememory": [{
"key": "Freememory",
"values": [
[121, 10]
]
}],
"BufferSize": [{
"key": "BufferSize",
"values": [
[123, 10]
]
}],
"TotalSwapMemory": [{
"key": "TotalSwapMemory",
"values": [
[125, 10]
]
}],
"UsedSwapMemory": [{
"key": "UsedSwapMemory",
"values": [
[127, 10]
]
}],
"FeeSwapMemory": [{
"key": "FeeSwapMemory",
"values": [
[129, 10]
]
}],
"": [{
"key": "",
"values": []
}]
}
i need to remove the last item which is empty there. I have followed Remove empty , but this does not work.
$scope.displayData = $scope.displayData.filter(function() { return true; });
console.log(angular.toJson($scope.displayData));