JavaScript Node.js Basics Building a Command Line Application Getting the Response Body

unexpected end of input

I can't ask my question in 120 char

const https = require("https");
const request = https.get("", response => {
    let responseBody = "";

     response.on("data", function(dataChunk) {

       responseBody = responseBody + dataChunk;

response.on("end", function(){

request.on("error", error => {

2 Answers

Brendan Whiting
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,633 Points

You're missing a closing }); which would fall on line 17 at the end of the file. Lines 10-end in your code are also not indented properly.

Most text editors, IDE's will help you avoid these kinds of errors by automatically generating closing braces, and by flagging errors with squiggly red underlines. The treehouse challenge online environment doesn't have a lot of those features, so sometimes it helps to work out the code in your own text editor, but that's not always possible.

That helps. Thank you.