Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postman console log not allowing to write string in next line

I am trying to display a string on multilines with \n in the Postman Console. How can I do this?

Example:

var mystr='line\n another line\n another line';
console.log(mystr);

Expecting:

line
another line
another line

Getting:

lineanother lineanother line

Note: it is working as expected in Firefox scratchpad.

like image 916
mitul jain Avatar asked Mar 06 '23 14:03

mitul jain


2 Answers

type 3 times console.log:

console.log('linea1');
console.log('linea2');
console.log('linea3');
like image 188
Eduardo Carvajal Avatar answered Mar 25 '23 07:03

Eduardo Carvajal


You can print multiline text like this:

console.log("hello", '\n', "world");

Which will show up like this in console:

enter image description here

like image 25
Jenny Avatar answered Mar 25 '23 05:03

Jenny