JavaScript string newline character?

后端 未结 15 2089
终归单人心
终归单人心 2020-11-22 08:06

Is \\n the universal newline character sequence in Javascript for all platforms? If not, how do I determine the character for the current environment?

I

15条回答
  •  孤城傲影
    2020-11-22 08:41

    You can use `` quotes (wich are below Esc button) with ES6. So you can write something like this:

    var text = `fjskdfjslfjsl
    skfjslfkjsldfjslfjs
    jfsfkjslfsljs`;
    

提交回复
热议问题