I feel so stupid. I can’t make a line break between the first call and the second. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I feel so stupid. I can’t make a line break between the first call and the second.

function sayHello(name, age) { document.write( name + " is " + age + " years old."); } sayHello("John", 20); sayHello("James", 19);

6th Sep 2019, 8:47 PM
Kimi
2 Answers
+ 9
the string "\n" inserts a line break. if you're using document.write() "\n" wouldn't work since the method is dom related. use document.write("<br/>");
6th Sep 2019, 9:09 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
0
Wow Brains that worked! Thank you!
6th Sep 2019, 9:39 PM
Kimi