Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,152 Points

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

1 Answer

Steven Parker
Steven Parker
221,082 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
221,082 Points

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

And happy holidays!   :christmas_tree: