Does javascript have literal strings?

后端 未结 6 1955
醉酒成梦
醉酒成梦 2020-12-05 12:48

In c# and ruby and many other languages you can denote a string as to not need escaping.
in c# its like this



        
6条回答
  •  心在旅途
    2020-12-05 13:08

    Literal strings are available through the use of ES6 language features. Node v4.x now supports these and around 90% of the other ES6 additions as well.

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings

    In JS string literals are known as Template Strings. And the syntax is pretty straight forward.

提交回复
热议问题