Сортировать строки массив JavaScript
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