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 trialJeanette Norin
1,952 PointsYou asked for a second if-statement on this task - which should then be "else if" - not "if".
The answer should take the else if statement, so we don't learn writing the wrong way :)
1 Answer
andren
28,558 PointsWith an else if
statement the code will only run if the if
statement it is attached to did not run. Since they wanted both of the if
statements to be run in this challenge it is correct to use two independent if
statements.
So having two if
statements in a row is not really "the wrong way" if you are testing separate unrelated things which is the case in this test.
Jeanette Norin
1,952 PointsJeanette Norin
1,952 PointsOkay, thanks! :)