ES6 和 coffeescript 中的多行字符串你更喜欢哪种?


ES6 中使用 ` (重音符,tab上面那个键):


 html = 
    `<strong>
         cup of coffeescript
       </strong>`;

CoffeeScript 使用三个引号(""" 或 ''')


 html = """
       <strong>
         cup of coffeescript
       </strong>
       """

感觉重音符和单引号不好区分,更喜欢三个引号的写法和 python 一样。
有没有必要上书W3C要求修改呢?

coffeescript es6 JavaScript

伊丽莎白大叔 10 years, 11 months ago

coffee

我de永恒 answered 10 years, 11 months ago

Your Answer