Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

use let instead of var to define loop variables #714

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaelKreil
Copy link

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?

@icecream17
Copy link
Contributor

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

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