I have an Object with the following structure:
[
{
titulo: '',
id: '',
imagen: '',
fecha: ''
},
{
titulo: '',
id: '',
imagen: '',
fecha: ''
},
{
titulo: '',
id: '',
imagen: '',
fecha: ''
},
{
titulo: '',
id: '',
imagen: '',
fecha: ''
}
]
I need to sort the object with a function similar to this:
this.articulos.sort( (a, b) => {
return a.fecha < b.fecha;
});
This works while I'm on the local Angular server, but when I compile it gives me the error error TS2339: Property 'sort' does not exist on type 'Object'.
How can I do this?