Force localeCompare to be case-sensitive
问题 I'm trying to use JavaScript's localeCompare function for sorting strings. I was surprised by the results of running the following lines in the devTools console: "a".localeCompare("b") // returns: -1 "A".localeCompare("b") // returns: -1 Another test: "b".localeCompare("a") // returns: 1 "B".localeCompare("a") // returns: 1 Even when I am more specific about my sort I get the same result: "a".localeCompare("b", { usage: "sort", sensitivity: 'variant' }) // -1 "A".localeCompare("b", { usage: