I’m working out javascript cookbook by shelley powers. And in the book,
If two string literals only vary based on case, the uppercase characters are lexically
greater than the lowercase letter:
var sOne = "Cat";
var sTwo = "cat";
if (sOne >= sTwo) // true, because 'C' is lexically greater than 'c'
but I cannot get the same result. this only works for me:
var sOne = "Cat";
var sTwo = "cat";
if (sOne < sTwo) alert("whatever here");
Here it pops up a alert.I’m pretty confusion.Thanks guys!
The book is incorrect. It’s listed in the errata.