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

Open
#112 9 comments 0 reactions 0 assignees View on GitHub

@gitdevjin is already working on this.

Since Oct 2, 2024.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
backend

Research direction

Start by reviewing index.js and README.md to locate each use of var and inspect its scope and usage. Replace the declarations with let or const as appropriate, then verify that both files contain no remaining var declarations and that the documented examples still match the code.

Written by the indexing model from the issue text.

Description

future
Description

According to the docs, 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
  • Updatevar with let or const in README.md file
Supporting Docs and Articles

w3schools variables
Why don’t we use var anymore?

Dominant language
JavaScript
Stars
2k
Forks
237
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from expressjs/cookie-parser

All issues in expressjs/cookie-parser

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.