If string is not converted, it is a headache.
If you are not careful when writing, you will not convert it. Then you will use it to test it out.
1<2
Right, just pass
Then
5.002>21.003
A strange result has occurred
When the data type is not converted to judge > and <, the system compares the unicode encoded values, and any result may occur
parseFloat(str1)>parseFloat(str2)
or
str1*1>str2*1
When comparing data in js, don’t forget to convert the type!