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

Akhand Pratap Singh
Akhand Pratap Singh
165 Points

Why the code doesn't show the result in the console?

const singleline = "Here is a string \ shown on just one line"; console.log(singleline);

1 Answer

Hi Akhand,

Are you trying to display the message on multiple lines like so:

const singleline = "Here is a string" + '\n' + "shown on just one line";
console.log(singleline);
Akhand Pratap Singh
Akhand Pratap Singh
165 Points

I am trying to write any simple code and get the display of output in console

Even const message = "Hello"; Console.log(message);

Even the above code is sufficient for me. Earlier I was getting hello displayed.but now nothing appears.