-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no more vars in Web/API (2) #18864
no more vars in Web/API (2) #18864
Conversation
* See mdn#16662 * See #10389 * See https://github.com/orgs/mdn/discussions/143 * Mostly automated via my ESLint setup, using the rules 'no-var' and 'prefer-const'
This comment was marked as resolved.
This comment was marked as resolved.
@@ -47,7 +47,7 @@ None ({{jsxref("undefined")}}). | |||
Here is a very simple example: | |||
|
|||
```js | |||
var Mytag = document.registerElement('my-tag'); | |||
const Mytag = document.registerElement('my-tag'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const Mytag = document.registerElement('my-tag'); | |
const myTag = document.registerElement('my-tag'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should stay the way it is, the following section reads:
Now the new tag is registered in the browser. The
Mytag
variable holds a
constructor that you can use to create amy-tag
element in the document as
follows:document.body.appendChild(new Mytag());
Co-authored-by: rubiesonthesky <2591240+rubiesonthesky@users.noreply.github.com>
files/en-us/web/api/cssstyledeclaration/msgetpropertyenabled/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/cssstyledeclaration/msputpropertyenabled/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/datatransferitem/getasfilesystemhandle/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Jean-Yves Perrier <jypenator@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Summary
Replaces
var
in Web/API withconst
where applicable andlet
otherwise.Mostly automated via my ESLint setup, using the rules
no-var
andprefer-const
Motivation
Metadata