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)))