Pre-recorded question

Question #152
In JavaScript, how to insert a carriage return in a string?
Answer

In JavaScript, you can use the special character \n to insert a carriage return in a string:

const my_string = 'A string \n with two carriage \n return';

If you console.log(my_string) the string, the expected output is:

A string 
 with two carriage 
 return

2 events in history
Answer by Alphonsio 08/31/2020 at 12:08:22 PM

In JavaScript, you can use the special character \n to insert a carriage return in a string:

const my_string = 'A string \n with two carriage \n return';

If you console.log(my_string) the string, the expected output is:

A string 
 with two carriage 
 return

Question by Alphonsio 08/31/2020 at 12:05:15 PM
In JavaScript, how to insert a carriage return in a string?
# ID Query URL Count

Icons proudly provided by Friconix.