1
I have an object with arrays inside, inside that array.. there are other objects! how can I know the total length of all arrays inside the first object! ex:
let items = {
0: [
{ foo: 'foo' },
{ bar: 'bar' },
], // length = 2
1: [
{ foo: 'foo' },
], // length = 1
}
let total = 0;
total += items[0].length;
total += items[1].length;
console.log(total);
Is there any less verbose way to run this excerpt ? example if I have 50~100 items it is impossible to keep this code