1

Is this a failure in JavaScript's attempt to convert them to numbers? If so, what numbers are they being converted to? Or what is the logic behind the string 10 being less than the string 9?

dc-
  • 1,878
  • 1
  • 15
  • 15

1 Answers1

12

It's comparing the strings "alphabetically", and 1 comes before 9 in the character "alphabet".

Blazemonger
  • 90,923
  • 26
  • 142
  • 180