1
I got the following array:
public arr = [
{ id: 1, name: 'João das Neves'},
{ id: 2, name: 'Areia Stark'},
{ id: 3, name: 'Sonsa Stark'}
];
I’d like to order that array by the attribute name
, thus remaining:
public arr = [
{ id: 2, name: 'Areia Stark'},
{ id: 1, name: 'João das Neves'},
{ id: 3, name: 'Sonsa Stark'}
];
How to order a array of objects using Typescript?
I like the names in the :D array
– Isac
Why "using Typescript"? It wouldn’t be the same if using Javascript normally?
– Luiz Felipe