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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Alana Warson](https://secure.gravatar.com/avatar/ef92f0d3a0977458c6b371f36b19b079?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alana Warson
5,296 Pointslion comes before zebra
How does ('lion' > 'zebra') true when "l" comes before "z?" Shouldn't it be true/
3 Answers
![Peter Vann](https://uploads.teamtreehouse.com/production/profile-photos/8935412/micro_MaiTaiPeteGravatar.jpg)
Peter Vann
36,426 PointsHi Alana!
( 'lion' > 'zebra' )
evaluates to false.
Quiz Question 4 of 7
Is the following condition true or false?
( 'lion' > 'zebra' )
Well done! When comparing strings, the first letter of the first string is compared to the first letter of the second string.
A
True. Since 'l' comes before 'z' in the alphabet, 'lion' is greater than 'zebra.'
B <--- I picked this answer and it passed
False. Since 'l' comes before 'z' in the alphabet, 'lion' is not greater than 'zebra.'
I hope that helps.
Stay safe and happy coding!
![Peter Vann](https://uploads.teamtreehouse.com/production/profile-photos/8935412/micro_MaiTaiPeteGravatar.jpg)
Peter Vann
36,426 PointsHi Alena!
In the computer world (and other places, too), 'z' is considered a higher character than 'a' (or 'l').
In a database, if you sorted a table of animals by the animal name in ascending (low to high/default) order, it will sort it from a-z.
If you sort in descending (high to low) order, it would sort z-a.
You can test it this way:
var animals = ["zebra", "aardvark", "lion"];
animals.sort(); // default sort is ascending (from low to high)
console.log(animals);
It should print out "Array(3)", which if you expand it, will give you:
0: "aardvark"
1: "lion"
2: "zebra"
length: 3
etc....
aardvark being the lowest value and zebra being the highest
I hope that helps.
Stay safe and happy coding!
![Alana Warson](https://secure.gravatar.com/avatar/ef92f0d3a0977458c6b371f36b19b079?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alana Warson
5,296 PointsHi Peter,
I want to thank you for your help with the "if" "else" comparison. I had no idea to copy and past in the challege, but I did and it worked. Thanks again ... I'm so thankful.
Alana
Alana Warson
5,296 PointsAlana Warson
5,296 Pointsyes, that is what I am asking why is it false when "l" comes before"z." It should be true