<!-- Thank you for reporting an issue. This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help Please fill in as much of the template below as you're able. Version: v9.3.0 Platform: Linux genius 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Subsystem: ES6 gramma If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you are able. --> * **Version**: v9.3.0 * **Platform**: Linux genius 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017 x86_64 * **Subsystem**: ES6 gramma <!-- Enter your issue details below this comment. --> I'm new to node and javascript, I expect this code should work: ``` function test() { let TMP = false; (function() { let TMP = TMP || true; })(); } test() ``` but when I run it, I get this error: ``` ReferenceError: TMP is not defined ```
Activity
apapirovski commentedon Jun 16, 2018
You're redeclaring TMP in that scope which means you can't access the outside TMP anymore.
In general, this tracker is for issues or bugs in Node.js core. This question would be better suited to https://github.com/nodejs/help/issues.
tiancaiamao commentedon Jun 17, 2018
Thank you for point out that. @trvsapjiac