MDN Web Docs 是一個開源的協作專案,它記錄了 Web 平台技術,包括 CSS、HTML、JavaScript 和 Web API,還為初級開發人員和學生提供廣泛的 🧑🎓 學習資源。
🙌 MDN 的使命
MDN 的使命是為更好的網際網路提供藍圖,並授權新一代開發人員和內容創造者來建構它。
MDN Web Docs 的強大之處在於其龐大的活躍讀者和貢獻者社區。 自 2005 年以來,大約有 45,000 名貢獻者創建了我們熟悉和喜愛的文件。 貢獻者共同創建了超過 45,000 個文件,這些文件構成了供全球 Web 開發人員使用的最新、全面且免費的資源。 除了英文文章,超過 35 名志願者負責中文、法文、日文、韓文、葡萄牙文、俄文和西班牙文的翻譯和本地化工作。
在他們的編號第 143 “Modernization of (static) code examples” 的討論中,提及到:
const 與 let 而非 var [ES6/2015]for...of 而非傳統的 for(;;) function keyword in samples, and check.<(e) => { return e.id } 可以寫成 (e) => e.id. (blog)'text' + ... + 'text'。額外的討論包括:
Additions from the discussion here:
Object.hasOwn() 而非 Object.hasOwnProperties() [ES2022]== -> === [pre-ES6]forEach 替換為 for...of [ES6/2015]for...of ,接著是 forEach(),最後如真需要才是 for(;;) 。a || b and a ? a : b by the nullish coalescing operator (??), and the optional chaining operator (.?) when pertinent. link to a concrete example [both ES2020]Promise.finally() [ES2018]await) (they already are ubiquitous on MDN for good reasons…) [ES2017]x 和 !x,而非 x === true 、 x === falseconst x = ['bli', 'bla', 'blo'] ,而非 const x = new Array('bli', 'bla', 'blo'))objName.objMember) 而非 bracket notation (objName['objMember'])討論持續進行中,有興趣的人也可以前往加入哦
© Copyrights 從想像到創造. All Rights Reserved.