I am working with a JSON webservice that has a specific format.
{ Name:['a','b'], Name:['cd','ef'], Age:{...}, Address:{...} }.
Within this object, there are 2 arrays & 2 objects, though the number of arrays and objects can vary. I am looking for a way to specifically count only the number of arrays within the main object. While there may be other solutions to my issue, I specifically need my code to be implemented in a .JS (JavaScript) file.
Initially, I attempted:
Object.keys(mainobject).length;
However, this approach provided me with a total count of both arrays and objects in the main object.