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 trialrajan lagah
2,539 PointsOn a new line, call the get method on the https object you created. Pass in the string of https://teamtreehouse.com/chal
why is it wrong https.get(--string--
);
const https=require('https');
const req=https.get(`https://teamtreehouse.com/chalkers.json.`,response=>{});
1 Answer
Stephan Olsen
6,650 PointsBe careful with creating unneccesary variables when doing challenges, as it may you may sometimes not pass the challenge because of it. With that being said let's see some of the things that's wrong here.
- You should not be saving the https.get() in a variable called req.
- You should only use single or double apostrophes for strings, not backticks as you've done in your case. Either "" or ''
- As your second parameter your making an arrow function named response, you should be making an anonymous function with a parameter called response
// Anonymous function
function(parameter) { }
Harinder Singh
4,214 PointsHarinder Singh
4,214 PointsThe guy in the tutorial also used backticks