Is it even possible to get length of all objects inside an array? Let say i have an array which looks like that:
var foo = [{
"id": 1,
"path": {
"1": [{
x: 21,
y: 22
}, {
x: 22,
y: 12
}],
"2": [{
x: 21,
y: 22
}, {
x: 22,
y: 12
}]
}
}];
for (let x in foo) {
var path = foo[x].path;
for (let c in path) {
console.log(path[c]);
}
}
How can i correctly get total lenght of objects inside path array here?