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

后端 未结 7 1306
孤街浪徒
孤街浪徒 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:14

    You should include it inside quotes '\n', See below,

    console.log('roleName = '+roleName+ '\n' + 
                 'role_ID = '+role_ID+  '\n' + 
                 'modal_ID = '+modal_ID+ '\n' +  
                 'related = '+related);
    

提交回复
热议问题