Urutkan JavaScript Objek Array String
let strArray = [{name: 'c' }, {name: 'a' }, {name: 'd' }, {name: 'b' }];
console.log(strArray.sort((a, b) => a.name.localCompare(b.name)))
// nodejs
console.log(strArray.sort((a, b) => a.name.localeCompare(b.name)))
Restu Wahyu Saputra