0
How does this results true?
let a = '14' < '6' console.log(a) //true
3 Antworten
+ 4
Both are strings!
The ascii value matters and not the value of the number
Ascii value of '6' > ascii value of '1'
Just like english dictionaries where the words are in alphabetical order.
Number sometimes make it confusing!
But see the ascii table!
Everything will be clear
+ 2
Here we are comparing strings "6" and "14".
String "6" is lexographically greater than "14". That's why it results true.