Performs a subsequent ordering of the elements in a sequence in ascending order, using the values itself as keys.
// "apple", "grape", "mango",
// "banana", "orange",
// "blueberry", "raspberry",
// "passionfruit"
Enumerable.create("grape", "passionfruit", "banana", "mango",
"orange", "raspberry", "apple", "blueberry")
.orderBy('x => x.length')
.then();
With comparer
// "mango", "grape", "apple",
// "orange", "banana",
// "raspberry", "blueberry",
// "passionfruit"
Enumerable.create("grape", "passionfruit", "banana", "mango",
"orange", "raspberry", "apple", "blueberry")
.orderBy('x => x.length')
.then(function(x, y) {
if (x < y) return 1;
if (x > y) return -1;
return 0;
});