I have an array of objects of the following form:
arr[0] = { \'item1\' : 1234, \'item2\' : \'a string\' };
I sort it first by \'item1\'>
\'item1\'>
You can just import type-comparator with npm and then use queue to do the chaining:
const comparator = queue([ map(x => x.item1, asc), map(x => x.item2, asc) ]); arr.sort(comparator);