0
why got it this result in compare two string? javascript
console.log("cos" < " year"); // false console.log("cos" < "year"); // true the first lenght 3 of "cos", "year" 4 3<4 ==true 3<5 == true -> be should it why got it the result false?
2 Antworten
+ 3
My guess is it checks each alphabets ASCII value with other Alphabets ASCII.
And here, ASCII of space is 32 and ASCII of small c is 99 so obviously 99 is greater than 32
0
🔫 Rick Grimes thanks!!