JSFiddle - React, Tailwind, and code Playground

JavaScript

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"
             }
        ]
    }
    
    ];

function findSum(arr) 
{
  return arr.reduce(function (a, b) 
 {
    return a + b.groups.length; 
  }, 0);
}
console.log(myObject.length);
console.log(myObject);


var totalSum = 0;

for (var i = 0; i < myObject.length; i += 1) 
{
totalSum = findSum(myObject[i]);
console.log(totalSum);
}