Skip to content

Instantly share code, notes, and snippets.

@zlrlo
Created July 26, 2023 09:58
Show Gist options
  • Select an option

  • Save zlrlo/4b5cb7d4b6aa2ebe13e0ee145a2eac61 to your computer and use it in GitHub Desktop.

Select an option

Save zlrlo/4b5cb7d4b6aa2ebe13e0ee145a2eac61 to your computer and use it in GitHub Desktop.
[JS] 정렬
function compare(a, b) {
if (a is less than b by some ordering criterion) {
return -1;
}
if (a is greater than b by the ordering criterion) {
return 1;
}
// a must be equal to b
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment