¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita+ 3
document.write("Hello");
document.write("<br/>");
document.write("World");
<br/> is used to break line in html. You are using document.write means it will write your data in html webpage, thatswhy \n is not working. \n work on console in browser.
+ 1
:) Try to add document.write("<br/>"); between the lines.