Skip to content

Instantly share code, notes, and snippets.

@AbeEstrada
Created September 3, 2025 00:45
Show Gist options
  • Save AbeEstrada/8b9085d129371133860ac22c3cfb5737 to your computer and use it in GitHub Desktop.
Save AbeEstrada/8b9085d129371133860ac22c3cfb5737 to your computer and use it in GitHub Desktop.
Exercise: Big Sorting
function bigSorting(unsorted) {
return unsorted.sort((a,b) => {
const bigA = BigInt(a);
const bigB = BigInt(b);
if (bigA < bigB) return -1;
if (bigA > bigB) return 1;
return 0;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment