I need to sort this array of objects
ben: FirebaseListObservable<any>;
e93menor = 9999;
e93mayor = 0;
this.ben = this.database.list('/Bencina');
this.ben.forEach(element =>{
this.b = [];
element.forEach(ele =>{
if(ele.idCiudad == this.idCiudadGlobal){
//console.log(ele)
if(ele.idTipoBencina == this.idTipoBencina){
if(parseInt(ele.precioBencina) >= this.e93mayor){
this.e93mayor = ele.precioBencina;
//SEGÚN MI LÓGICA AQUI DEBERIA GUARDARME LOS ELEMENTOS DE MAYOR A MENOR
this.b.push(ele);
console.log(ele);
}
}else{
}
}
})
})