title: How to remove empty key from object in angularjs?
body: <p>I have an JSONarray which looks like this,</p>
  
  <pre><code>        {
          "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": []
          }]
      }
  </code></pre>
  
  <p>i need to remove the last item which is empty there. I have followed <a href="https://stackoverflow.com/questions/281264/remove-empty-elements-from-an-array-in-javascript">Remove empty</a> , but this does not work.</p>
  
  <pre><code>$scope.displayData  = $scope.displayData.filter(function() { return true; });
  console.log(angular.toJson($scope.displayData));
  </code></pre>