title: Access JSON sub levels by name
body: <p>I have the following example JSON</p>
  
  <pre><code>var data = {
    "menu": [
      {
        "name": "Event A",
        "sub": [{
            "name": "Sub Event A 1",
            "sub": null
          },
          {
            "name": "Sub Event A 2",
            "sub": [{
                "name": "Sub Sub Event A 2",
                "sub": null
              }]
          }
        ]
      },
      {
        "name": "Event B",
        "sub": [{
            "name": "Sub Event B 1",
            "sub": null
          },
          {
            "name": "Sub Event B 2",
            "sub": [{
                "name": "Sub Sub Event B 2",
                "sub": null
              }]
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>When I'm creating a menu I can easily choose whether to use <code>Event A</code> or <code>Event B</code> as the source as follows:</p>
  
  <pre><code>$(data.menu[0].sub).each(function(){ /* menu[0] therefore first, Event A */
      $menu1.append(
        getMenuItem1(this)
      );
  });
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>Is it possible to select this by the value of the <code>name</code> field?</p>
  
  <p>Something like: <code>$(data.menu[name="Event A"].sub)</code></p>