Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLiam Smith
1,407 PointsCan someone help me to understand this question. I thought the answer was true as the L in Lion comes before the Z
Can someone help me to understand this question? I thought the answer was true as the L in Lion comes before the Z in Zebra in the alphabet, making Lion greater than Zebra. Thanks
4 Answers
Steven Parker
231,268 PointsThink about numbers for a moment. For example, 3 comes before 5 — so 3 is less than 5.
Likewise in letters, L comes before Z — so L is less than Z.
Jamie Reardon
Treehouse Project ReviewerHi Liam Smith, when comparing strings, the first letter of the first string is compared to the first letter of the second string.
Rich Donnellan
Treehouse Moderator 27,696 PointsJavaScript strings are compared by their Unicode values. Take a look at this table and refer even to the Decimal values (e.g. l: 108
vs. z: 122
), which might make a little more sense.
Liam Smith
1,407 PointsThank you very much for your help everyone. I think I misunderstood that bit in the track.