title: Javascript: removing elements from Json by value
body: <p>I need to remove elements from a json string returned by an AJAX call.</p>
  
  <p>I'm not sure how to loop through the string and remove all elements where the value i NULL.</p>
  
  <p>My json looks like this.</p>
  
  <pre><code>[
   {"ID":"27","Agility":"15","Balance":null,"Strength":"37","Physiology":"32"},
   {"ID":"30","Agility":"27","Balance":null,"Strength":null,"Physiology":null},
   {"ID":"34","Agility":null,"Balance":null,"Strength":null,"Physiology":null},
   {"ID":"36","Agility":null,"Balance":null,"Strength":null,"Physiology":null},
   {"ID":"40","Agility":null,"Balance":"20","Strength":null,"Physiology":"34"},
   {"ID":"42","Agility":null,"Balance":"16","Strength":null,"Physiology":null},
   {"ID":"51","Agility":null,"Balance":null,"Strength":"39","Physiology":null}
  ]
  </code></pre>
  
  <p>I thought I might do something like this for every key but i would prefer a generic function:</p>
  
  <pre><code>if(json[index].Strength == null){
      json.splice(index,1);
  }
  </code></pre>