为什么javascript换行不起作用?

为什么javascript换行不起作用?,javascript,Javascript,我需要显示代码,就像我通过代码显示的一样,正如您所看到的。我想在代码中画一幅画。但断线不起作用。输出显示一行中的所有内容 console.log(document.write('*********\n')) console.log(document.write('******\n')) console.log(document.write('**\n')) console.log(document.write('******\n')) console.log(document.write('*

我需要显示代码,就像我通过代码显示的一样,正如您所看到的。我想在代码中画一幅画。但断线不起作用。输出显示一行中的所有内容

console.log(document.write('*********\n'))
console.log(document.write('******\n'))
console.log(document.write('**\n'))
console.log(document.write('******\n'))
console.log(document.write('******\n'))
console.log(document.write('*********\n'))
console.log(document.write('************\n'))
console.log(document.write('*********
')) console.log(document.write('***
')) console.log(document.write('**
')) console.log(document.write('***
')) console.log(document.write('******
')) console.log(document.write('*********
'))
console.log(document.write('*********
'))
不需要半列;在每行的末尾?@ TeeBeO -不,它们不使用。而不是使用<代码> \n>代码>您可能需要使用<代码> BR> < /代码>。您需要使用控制台。log(文档。所以那些
console.log
s是非常有用的,请不要回答重复的问题;这使得移除它们变得更加困难。这个答案基本上和复本答案中给出的建议是一样的。好的,我会的。我的问题不是复本,先生。是的,答案可能在那里找到,但我不明白,因此我问了自己的特定问题相关的问题。所以你最好停止不必要地重复我的问题。