expressjs / expressjs/cookie-parser

Replace `var` with `let` and `const`

Open
#112 9 comments 0 reactions 0 assignees View on GitHub
future
Dominant language
JavaScript
Stars
2k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

### Description
According to [the docs](https://www.w3schools.com/js/js_variables.asp), using `var` is not recommended, unless it's necessary, It would be useful to replace `var` in `index.js` with `let` or `const` depending on their scope and usage. And also as it's less error-prone, this change can make the code more robust for the possible future code change.

### Task
- Replace `var` with `let` or `const` in `index.js` file
- Update`var` with `let` or `const` in `README.md` file

### Supporting Docs and Articles
[w3schools variables](https://www.w3schools.com/js/js_variables.asp)
[Why don’t we use `var` anymore?](https://medium.com/@codingsam/awesome-javascript-no-more-var-working-title-999428999994)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.