Skip to content

Instantly share code, notes, and snippets.

@xexi
Created February 2, 2017 06:29
Show Gist options
  • Save xexi/a015448db6436c8f6632e1cad0086e59 to your computer and use it in GitHub Desktop.
Save xexi/a015448db6436c8f6632e1cad0086e59 to your computer and use it in GitHub Desktop.
var korean = [ "다", "나", "가" ];
function ascending ( a , b ) {
return a.localeCompare ( b );
}
function descending ( a , b ) {
return b.localeCompare ( a );
}
console.log('asc: '+korean.sort(ascending));
console.log('desc: '+korean.sort(descending));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment