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 Improving the Random Number Guessing Game

koukoujohn
koukoujohn
17,457 Points

Can someone check my script?

https://w.trhou.se/3by98tay5d

At line 16 I have written else instead of "else if" and the condition. It gives me the same results. Is it wrong that I didn't check the ">" condition?

I supposed that since I don't have equality "===" or "< less than" then I don't need the third ">" condition and that it saves me some time.

Is that wrong as a procedure? Why is "else if" at line 16 a better practice?

2 Answers

What if the user or the player instead of typing in a number types in a character like 's' or 't' ...wud you still want it to still say the answer is greator than the guess?

koukoujohn
koukoujohn
17,457 Points

I see now, thanks!

you welcome