You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, here are some thoughts on changes we could make to the code guide to incorporate newer JS features into them. Normally I would open a PR to propose these, but since it is a wiki page, this seemed like the right place to articulate these first.
I read through the code guide and did some perusing through the current set of examples to get a sense of what the general usage and patterns were and would like to propose adding the following to the JavaScript section of the Code Guide:
Use let and const instead of var
Use for...of instead of for loops that don't rely on an index for their logic
Update class syntax to use class fields (as in, replace this.foo; with foo; in class declarations)
Use static methods and blocks for shared utilities specific to an example.
Standardize on using a global object when creating new functions and classes. A lot of examples do this but some do not and it is not called out in the code guide. (For example, use const aria = aria || {};)
The text was updated successfully, but these errors were encountered:
Hi, here are some thoughts on changes we could make to the code guide to incorporate newer JS features into them. Normally I would open a PR to propose these, but since it is a wiki page, this seemed like the right place to articulate these first.
I read through the code guide and did some perusing through the current set of examples to get a sense of what the general usage and patterns were and would like to propose adding the following to the JavaScript section of the Code Guide:
let
andconst
instead ofvar
for...of
instead offor
loops that don't rely on an index for their logicthis.foo;
withfoo;
in class declarations)const aria = aria || {};
)The text was updated successfully, but these errors were encountered: