現在主要的 Style guide 有 StandardJS, Airbnb, Google 三家
我自己雖然偏好 Standard 但現在也轉向其它兩家 (懶得加分號啊~)
這裡列出 Google Style Guide 的一些特色
- 使用兩個空白 (別用四個空白或 tab)。
- 請記得加入分號。
- 先別用 ES6 module export,因為語意尚未完全定義。
- 別使用 var,改使用 let, const。
- 盡可能使用 arrow function。
- 使用 template String,並且大括號內部變數不需要額外空白如: `${variable}`。
- const 所宣告的變數使用全大寫。
- 字串使用單引號。
介紹: https://goo.gl/5RufGG
Google JavaScript Style Guide:
https://google.github.io/styleguide/jsguide.html
「javascript string template variable」的推薦目錄:
- 關於javascript string template variable 在 卡斯伯 Facebook 的最佳解答
- 關於javascript string template variable 在 Format string template with variables in Javascript - Stack ... 的評價
- 關於javascript string template variable 在 JavaScript Template Literals 的評價
- 關於javascript string template variable 在 網頁開發雜記- JS string literal 深入介紹與範例 - Facebook 的評價
- 關於javascript string template variable 在 if statement inside string template literals and lit-html. - gist ... 的評價
- 關於javascript string template variable 在 nunjucks templating docs - Project Lists 的評價
- 關於javascript string template variable 在 Tagged Template Literals - YouTube 的評價
javascript string template variable 在 JavaScript Template Literals 的推薦與評價
Variable and expression substitutions ... At this point, a template literal is just like a better version of a normal JavaScript string. The big difference ... ... <看更多>
javascript string template variable 在 網頁開發雜記- JS string literal 深入介紹與範例 - Facebook 的推薦與評價
JS string literal 深入介紹與範例`string ${variable}` 此文介紹了string literal ... 最後一段的tagged template literal 是比較不常見的用法, ... ... <看更多>
javascript string template variable 在 Format string template with variables in Javascript - Stack ... 的推薦與評價
... <看更多>
相關內容