Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Why does comparing a small value to a larger value gives true in JavaScript?
Asked
May 12 '22 at 07:09
Active
May 12 '22 at 07:09
Viewed
17 times
-4
Why does Comparing the following two string values return true?
alert("2" > "12");
javascript
string
asked May 12 '22 at 07:09
Shahad Abd Alwahab
29
5
1
you are comparing two strings: so 2 comes after 1 in alfabetical order. You are not comparing integers
–
Lelio Faieta
May 12 '22 at 07:11
0 Answers
0