+ 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 Antworten
+ 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
᠌᠌Code X
᠌᠌Code X - avatar
0
Wow Brains that worked! Thank you!
6th Sep 2019, 9:39 PM
Kimi