-
Notifications
You must be signed in to change notification settings - Fork 600
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
use const to replace var #579
Comments
Happy to accept PRs to make those changes. |
Hi @mhdawson I've opened a PR for this. I've replaced var with const, and with let where mutability is required. Please review it and let me know if there are any further improvements I could make. Thanks in advance. |
Closing as PR to address has landed. @yermartee many thanks for your contribution. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Such as https://github.com/nodejs/node-addon-examples/blob/main/src/1-getting-started/1_hello_world/nan/hello.js
A variable declared with var is accessible in the whole module. Thus, the variable can be accessed before its initialization and outside the block where it is declared.
See MDN web docs for more details.
Unsafe fix: Use 'const' instead.
The text was updated successfully, but these errors were encountered: