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

Not understandable syntax error

After the node.js course, I decided to go ahead and practice, I'm trying to make a program that when you'll type an Instagram username it will tell you how many followers does he have. But unfortunately I god a syntax error. The code: const https = require('https');

const request = https.get("https://www.instagram.com/HELLO/", function(response){ let body = ""; response.on('data', data function() { body += data.toString(); }); response.on('end', function() { var data = JSON.parse(body); console.log(data); }); });

The error: AyntaxError: missing ) after argument list.

1 Answer

Steven Parker
Steven Parker
231,007 Points

It looks like you have a stray word.

I suspect the word data right before the anonymous function in the second argument to response.on doesn't belong.