Why output is true? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why output is true?

alert('nine' < 'seven') Why output is true? Thanks!

20th Nov 2018, 4:50 PM
Rex Hung
2 Answers
+ 5
Strings are compared using their alphabetical order. 'nine' starts with 'n', which comes before 's', so 'nine' < 'seven'.
20th Nov 2018, 5:33 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 2
Thanks
21st Nov 2018, 2:40 PM
Rex Hung