why “Single-quoted string preferred over double-quoted string.” in js?

前端 未结 4 2482
不知归路
不知归路 2021-02-19 01:22

While using gjslint, I got a hint: \"Single-quoted string preferred over double-quoted string\".

So why? I\'m a little confused with this. Why single-quoted preferred?

4条回答
  •  没有蜡笔的小新
    2021-02-19 01:35

    My keyboard has a '/" key so I can easily type a single quote but need to press shift for the double quote. :)

    As for the JSLint warnings its just trying to enforce an arbitrary standard in order to promote a more consistent coding style, just like how it does on other spacing and indentation issues.

提交回复
热议问题