title: How to Get the filter result from array object in javascript?
body: <p>I am trying to get the filter result out from the json where the matched is true.</p>
  
  <pre><code>{
          "cat": [
              {
                  "volume": "one",
                  "category": [
                      {
                          "name": "Alpha",
                          "matched": true
                      },
                      {
                          "name": "Gamma",
                          "matched": false
                      }
                  ]
              },
              {
                  "volume": "two",
                  "category": [
                      {
                          "name": "Beta",
                          "matched": false
                      },
                      {
                          "name": "Treta",
                          "matched": true
                      },
                      {
                          "name": "Neutral",
                          "matched": false
                      }
                  ]
              },
              {
                  "volume": "three",
                  "category": [
                      {
                          "name": "Retro",
                          "matched": false
                      },
                      {
                          "name": "Jazz",
                          "matched": true
                      },
                      {
                          "name": "Rock",
                          "matched": false
                      },
                      {
                          "name": "Soft",
                          "matched": false
                      }
                  ]
              }
          ]
  }
  </code></pre>
  
  <p>Used Javascript filter </p>
  
  <pre><code>var jsonwant = jsonusing.cat.filter(function(e){
      return e.category.filter(function(e1){
          return e1.matched === true;
  });
  });
  </code></pre>
  
  <p>Js Fiddle for same </p>
  
  <p><a href="http://jsfiddle.net/xjdfaey3/" rel="nofollow">http://jsfiddle.net/xjdfaey3/</a></p>
  
  <p>Result Should Come as</p>
  
  <pre><code>"cat": [
                  {
                      "volume": "one",
                      "category": [
                          {
                              "name": "Alpha",
                              "matched": true
                          }
                      ]
                  },
                  {
                      "volume": "two",
                      "category": [
                          {
                              "name": "Treta",
                              "matched": true
                          }
                      ]
                  },
                  {
                      "volume": "three",
                      "category": [
                          {
                              "name": "Jazz",
                              "matched": true
                          }
                      ]
                  }
              ]
  </code></pre>
  
  <p>but it is returning entire object.</p>