Compares two values by their length property. Puts the value with the shorter length first.
length
['abc', 'a', 'ab'].sort(byLength) == ['a', 'ab', 'abc'];
first value
second value
Generated using TypeDoc
Compares two values by their
length
property. Puts the value with the shorter length first.Example