8
Suppose an object as follows:
vendas = {
obs1:{
Venda1:{Regiao:"Norte", Valor: 200},
Venda2:{Regiao:"Sul", Valor:100}
},
obs2:{
Venda1:{Regiao:"Norte", Valor: 50},
Venda2:{Regiao:"Sul", Valor:20}
}
}
What are the ways to know the "size" of the object, that is, how many "other objects" are inside it?
By "size" do you mean the number of bytes the object occupies in memory or the amount of attributes? It might be nice to edit the question to make it clearer. : ) (I ask this because I understood in your answer that the return with
Object.keys
is2
)– Luiz Vieira
@Luizvieira Number of attributes, really not clear! I edited to try to improve.
– Carlos Cinelli