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)
![Paula Simon](https://secure.gravatar.com/avatar/78aadbaf18b39083a11a442350e28c87?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Paula Simon
8,056 PointsHow can I better understand when to use to.UpperCase vs to.LowerCase on conditional statements?
Hello! I am learning about conditional statements in JavaScript. For this video, Guil uses to.UpperCase for the answer "Mercury". Since it works with both "MERCURY" and "mercury" as answers, why/when would it be appropriate to use to.UpperCase vs. to.LowerCase?
Thanks!
2 Answers
![Sean Paulson](https://uploads.teamtreehouse.com/production/profile-photos/11515112/micro_35296314_2173959502631843_1143319572640694272_o.jpg)
Sean Paulson
6,669 PointstoLowerCase and toUpperCase just return the text to lower or upper case.
say for example you want to end a program if a user types "quit". Well that user could enter "Quit", "qUiT", QUIt" or any other input. So you want to force that input to be lower case because your string you are testing against is lower case.
If you are comparing your user input to a upper case string you would force the user input to be uper case with toUpperCase.
Thats why the example you gave works either way because no matter what the input is toUpperCase will force it to be upper case.
![Joseph Yhu](https://uploads.teamtreehouse.com/production/profile-photos/10742228/micro_121009504_105928134617925_5772733173913238661_n.jpg)
Joseph Yhu
PHP Development Techdegree Graduate 48,637 PointsIt shouldn't matter.
Paula Simon
8,056 PointsPaula Simon
8,056 PointsI see, thank you for explaining that in-depth!