1

I want to sort an object array with using multiple keys. Please find the working example here.

var temp = _.sortBy(array, ['Chemical', 'LocName']);

in the sorted array Tetrachloroethene appears before cis-1,2-Dichloroethene, why its sorting T before c and how can I correct it.

Gevin
  • 37
  • 4
  • 3
    "*why its sorting T before c*" `"T".charCodeAt(0) //84` while `"c".charCodeAt(0) //99`. What order do you expect? Lowercase letters before uppercase? Case-insensitive? – VLAZ Jun 21 '22 at 14:36
  • This will work [Underscore.js Case Insensitive Sorting](https://stackoverflow.com/questions/25873635/underscore-js-case-insensitive-sorting) – rmgimenez Jun 21 '22 at 14:42

0 Answers0