Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (7k points)

 I want my code to return 

Hello \n world

But I am getting

Hello

world

How can I get the output I intend?

1 Answer

0 votes
by (13.1k points)

You have to use \ and \\, which would tell the interpreter just to produce the character without processing as a special command

var i=’Hello \\n World’;

console.log(i);

Want to be a full stack developer? Check out the full stack developer course from Intellipaat. 

Related questions

0 votes
1 answer
asked Apr 13, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...