I am fairly confused about these conflicts outputs, even after researching about it. alert("nine" < "seven"); Output: true But why this statement below is false? alert("less" < "greatgreat"); Output: false Is it compared by length or alphabetic order of strings?
3/6/2019 5:51:52 PM
Luis Febro 🇧🇷2 Answers
New AnswerComparing data of different types may give unexpected results. When comparing two strings, it compares the strings alphabetically. 'n' comes before 's' hence true. 'l' comes after 'g' hence, false.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message