You are viewing a single comment's thread. Return to all comments →
Here is my sorting function:
const LESS_THAN = -1; const EQUAL = 0; const GREATER_THAN = 1; function compare(a, b) { if (a === b) { return EQUAL; } if (a.length < b.length) { return LESS_THAN; } if (a.length > b.length) { return GREATER_THAN; } if ([a, b].sort()[0] === a) { return LESS_THAN; } else { return GREATER_THAN; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
Here is my sorting function: