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 trialVadim Zelenin
13,045 PointsFollowed examples don't work for me
When I'm trying to implement what Huston has written:
!function(underscore){
underscore.someawesomemethod = "Really cool";
console.log(underscore.VERSION);
}(_);
I've got an error that tells me: "Uncaught ReferenceError: _ is not defined"
What do I do wrong?
4 Answers
LaVaughn Haynes
12,397 Pointsmake sure that you have the underscore library linked in your html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
</head>
<body>
<!-- underscore linked below -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script>
!function(underscore){
underscore.someawesomemethod = "Really cool";
console.log(underscore.VERSION);
}(_);
</script>
</body>
</html>
David Eichel
28,860 PointsThis video is a trainwreck. He references libraries and things that have never been talked about before on the "full stack javascript" track. This needs to be split up into a few courses. It feels way too rushed.
sradms0
Treehouse Project ReviewerI just watched this....and yes, I feel the exact same way.
Brigette Eckert
16,957 PointsI've got in linked in index and still having the uncaught ref error issues for (_)
Unsubscribed User
48,988 PointsWorked perfect. Thanks
Vadim Zelenin
13,045 PointsVadim Zelenin
13,045 PointsOh I really missed it. Thank you
Michael Kellogg
774 PointsMichael Kellogg
774 PointsWould be good if in the video he would show doing this. Otherwise it just magically shows up and people following along have no idea.