0
Well, it’s like the title said, I wonder if there’s any way I could arrange a array
of objects of increasing shape according to the value of an attribute given to it.
Example:
var objetos = []
var objeto1 {id:gerarId(), nome: nome1, idade: idade1}
var objeto2 {id:gerarId(), nome: nome2, idade: idade2}
objetos.push(objeto1);
objetos.push(objeto2);
And like now I wanted to organize it in ascending order according to the value of age.
Detail: I’m using the localstorage
to store the data, and I want to do everything in javascript.
I think what you want is this https://answall.com/questions/100068/order-um-array-de-objects-por-data/100076#100076
– Marconi