title: JSON Object array inside array find and replace in javascript
body: <p>I have one JSON Object like this :</p>
  
  <pre><code>var myObject = [    
  {
      "Name" : "app1",
      "id" : "1",
      "groups" : [
          { "id" : "test1", 
            "name" : "test group 1", 
            "desc" : "this is a test group"
           },
          { "id" : "test2",
            "name" : "test group 2",
            "desc" : "this is another test group"
           }
      ]
  },
  {
      "Name" : "app2",
      "id" : "2",
      "groups" : [
          { "id" : "test3", 
            "name" : "test group 4", 
            "desc" : "this is a test group"
           },
          { "id" : "test4",
            "name" : "test group 4",
            "desc" : "this is another test group"
           }
      ]
  },
   {
      "Name" : "app3",
      "id" : "3",
      "groups" : [
          { "id" : "test5", 
            "name" : "test group 5", 
            "desc" : "this is a test group"
           },
          { "id" : "test6",
            "name" : "test group 6",
            "desc" : "this is another test group"
           }
      ]
  }
  
  ];
  </code></pre>
  
  <p>I have new value available of "name" for specific "id".
  How can I replace "name" of specific "id" inside any object ? </p>
  
  <p>And how to count total number of groups among all objects ?</p>
  
  <p>for example : replace name to "test grp45" for id = "test1"</p>
  
  <p>Here is fiddle
  <a href="http://jsfiddle.net/qLTB7/21/" rel="noreferrer">http://jsfiddle.net/qLTB7/21/</a></p>