title: How to Filter a complex json object using javascript?
body: <p>I have the following json object :</p>
  
  <pre><code>var json = {
      "Lofts": "none",
      "Maisons": "2",
      "HOMES": [{
          "home_id": "1",
          "price": "925",
          "num_of_beds": "2"
      }, {
          "home_id": "2",
          "price": "1425",
          "num_of_beds": "4",
      }, {
          "home_id": "3",
          "price": "333",
          "num_of_beds": "5",
      }]
  };
  </code></pre>
  
  <p>How can I filter this object and remain with the HOMES property where home_id = 2 ?</p>
  
  <p>Result:</p>
  
  <pre><code>var json = {
      "Lofts": "none",
      "Maisons": "2",
      "HOMES": [{
          "home_id": "2",
          "price": "1425",
          "num_of_beds": "4",
      }]
  };
  </code></pre>
  
  <p>Is there any way I can cycle the object and mantein all the properties( also lofts and maisons)? </p>
  
  <p>Thanks</p>