EDITABLE CODE:
LiveDemo: JavaScript String Object : localeCompare() Methods
Note:The localeCompare() implements comparison based on local standards and is case sensitive.