how to create line breaks in console.log() in node

后端 未结 7 1651
一生所求
一生所求 2021-01-01 13:11

Is there a way to get new lines in console.log when printing multiple objects?

Suppose we have console.log(a,b,c) where a, b,

7条回答
  •  佛祖请我去吃肉
    2021-01-01 13:28

    Without adding white space at start of new line:-

    console.log("one\ntwo");

    output:-

    one

    two

    This will add white space at start of new line:-

    console.log("one","\n","two");

    output:-

    one

    two

提交回复
热议问题