I used <to compare two lines as follows:
console.log('ca'<'bb'); //false
I already know that it compares the number of Unicode characters. Because cno less b.
However, when I do this:
console.log('ba'<'bb');//true
It bothers me, because bno less than bit seems that he just missed it and compared the next character.
In any case, I wonder what rule is here when <or is >used to compare two lines and for some difficult situations, what if two lines have different lengths?
source
share