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 trialChris Gauthier
Courses Plus Student 6,434 Pointsnode.js call back function unclear
Hello! I'm getting an error running this script to pass the validator. Im not sure what the validator wants for a callback function -- ie) What is the anonymous call/back function supposed to be doing, so I can write it to pass the validation. Thanks Chris
var https = require("https");
var get = https.get("https://teamtreehouse.com/chalkers.json", function(response) { } ");
1 Answer
Loris Guerra
17,536 PointsThe problem here is the double quotes after the callback function. The get() method takes 2 arguments, a string and a function. Simply remove them, and you're OK!