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__ROLLER__ Angel
25,606 PointsDid you also have to comment out use strict; to get the /blog route to show the posts?
If I don't comment out use strict I get a reference error that posts is not defined. FYI My project is inside the Projects folder of my workspace: https://w.trhou.se/jxez3wa37f
2 Answers
Seth Kroger
56,413 PointsI believe with 'use strict'; you have to use var
(or it's ES6 equivalents) to declare all variables the first time and you left it off when declaring posts
.
__ROLLER__ Angel
25,606 PointsI didn't notice that! Thanks for the heads up.
__ROLLER__ Angel
25,606 Points__ROLLER__ Angel
25,606 PointsTrue, it works now. Houston did it without the var keyword in the video.
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsIf you go back and check, you'll see he uses a comma after the first require instead of a semi-colon. That makes the two variables part of the same var statement.