I want to sort this array by ascending
const data = ["10", "11", "12", "13", "14", "3", "35 ½", "36", "36 ⅔", "37 ⅓", "38", "38 ⅔", "4", "40"]
I used this logic but not work
data.sort((a: string, b: string) => +(a > b) || -(a < b))
Expect result:
const data = ["3", "4", "10", "11", "12", "13", "14", "35 ½", "36", "37 ⅓", "38", "38 ⅔", "40"]