FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

use let instead of var to define loop variables by MichaelKreil · Pull Request #714 · atom/language-javascript · GitHub

This repository was archived by the owner on Dec 15, 2022. It is now read-only.
/ language-javascript Public archive

use let instead of var to define loop variables - #714

Open
MichaelKreil wants to merge 1 commit into
atom:masterfrom
MichaelKreil:patch-1
Open

MichaelKreil wants to merge 1 commit into
atom:masterfrom
MichaelKreil:patch-1

Conversation

Copy link
Copy Markdown

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Use "let" instead of "var" to define loop variables.

Alternate Designs

I can't see any other approaches.

Benefits

Defining loop variables with "var" can lead to unwanted side effects. Therefore it is recommended to use "let".

Possible Drawbacks

There might be some developers who are not using ES6, like very old legacy versions of node.js. I believe node.js uses "let" since version 4.0.

Applicable Issues

At some point, we will have to switch to "let". The question is: when, if not now?

Copy link
Copy Markdown
Contributor

Actually I redact that approval since there's one that also uses const, see #691

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL