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 Foundations Variables Hoisting

yosef levertov
yosef levertov
5,497 Points

Can't figure this out

Having trouble with the hoisting assignment. Anyone know the answer to this one?

1 Answer

Thomas Ireland
PLUS
Thomas Ireland
Courses Plus Student 8,216 Points

You variable should be declared before your if statement. Additional hint: "var" will only be declared once, too. Cheers. Tom.