When tracing out variables in the console, How to create a new line?

后端 未结 7 1525
孤街浪徒
孤街浪徒 2021-01-30 03:39

So I\'m trying to do something simple, I want to break up my traces in the console into several lines, using 1 console.log statement:

console.log(\'roleName = \'         


        
7条回答
  •  你的背包
    2021-01-30 04:24

    console.log('Hello, \n' + 
                'Text under your Header\n' + 
                '-------------------------\n' + 
                'More Text\n' +
                'Moree Text\n' +
                'Moooooer Text\n' );
    

    This works great for me for text only, and easy on the eye.

提交回复
热议问题