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

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements The Conditional Challenge

Feedback

HI all just another person looking for feedback, please be gentle!

https://w.trhou.se/hl9fml922b

Tommy Gebru
Tommy Gebru
30,164 Points

Great work with this quiz Thomas, I enjoyed the trivia alongside the math questions! :eyes:

1 Answer

Steven Parker
Steven Parker
230,274 Points

Looks like you're off to a good start! But I wasn't quite sure if you were simply experimenting with different ways of doing things or not. In case not, here's a few suggestions for future projects:

  • if you make some inputs case-insensitive, it might make sense to make them all that way
  • the same case insensitivity trick can also prevent needing to compare to multiple answer versions
  • you can save on numeric conversions by just comparing to strings (like: mathAdd == "4")
  • in an "else if" chain, the last term can be a plain "else" since all other cases have been handled
  • inequalities can save needing multiple comparisons (like "else if (right >= 3)")

Thanks, that was incredibly helpful greatly appreciate the feedback. There is definitely a lot of experimenting going on and some lack of knowledge. Is it proper etiquette to declare variables at the top or is that not a thing?

Steven Parker
Steven Parker
230,274 Points

Declaring the variables at the top is definitely a "best practice" and good habit to develop!

And happy holidays!   :christmas_tree: