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

Working on JS - Hoisting module

Here are the instructions --> Alter the 'elevatorCloseButton' function to follow the best practices in declaring variables within the scope of the function.

Here's the code I wrote --> http://collabedit.com/46ca4

Here's what it's telling me ---> You should assign the 'status' in the if statement.

Any thoughts on what I'm doing wrong?

5 Answers

Any thoughts on what I'm doing wrong?

Blah I'm having trouble adding the code I wrote.

trying again

Gustavo Suarez
Gustavo Suarez
4,053 Points

Try just initiating the variable, but not assigning it a value. I've edited your example http://collabedit.com/46ca4

Awesome! Thanks Gustavo. That did the trick.