- other ECMAScripts: typeScript, coffeeScript
- like property in c sharp: get, set
- use ... to concatenate a list
- naming: iAmAMethod, iAmAVariable
- use let or const instead of var
- indent: two space instead of tab
- a line should be less then 80 columns
- apart from DOM (document), there is a BOM (browser)
- it has yield
- 1 == '1'; 1 !== '1' (=== will not cast)
- field name can be variable:
- let x = 'C';
- let obj = {A: a, }
JavaScript that I just know about
最新推荐文章于 2025-09-22 23:32:17 发布
本文探讨了使用TypeScript和CoffeeScript等ECMAScript的变种进行编程时的最佳实践,包括属性的get和set方法,使用let和const代替var,代码缩进采用两个空格而非制表符,以及每行代码不超过80列的限制。此外,还讨论了DOM之外的BOM概念,yield关键字的使用,类型比较与字段名变量的应用。
938

被折叠的 条评论
为什么被折叠?



