I'm trying to figure out how to get the number of nested objects in the object a
.
a = {
firstNested: {
name: 'George'
}
secondNested: {
name: 'James'
}
}
I thought about using .length
, which is typically used for arrays. What would be the best approach in this situation?