To use Lodash to sort array of object by value with JavaScript, we use the orderBy method.
For instance, we write
const sortedChars = _.orderBy(chars, ["name"], ["asc"]);
to call orderBy to sort the chars array by the name property of each object in chars.
We use ['asc'] to specify that we sort by ascending order.