Returns an array which is sorted by passed object property
npm install sort-object-array-by-property$ npm i sort-object-array-by-property
js
const sortObjectArrayByProperty = require('sort-object-array-by-property')
const objectArray = [{
name: "Adam",
age: 34
}, {
name: "Berta",
age: 33
}, {
name: "Carlos",
age: 30
}];
console.log(objectArray.sort(sortObjectArrayByProperty('name')))
``