-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Weird Behavior of let: letting a variable to itself while defining the variable renders variable as existed #34285
Comments
let
: letting a variable to itself while defining the variable renders variable as existed
Duplicate of #34285 |
#34825 is this issue. Could you clarify which is the original issue that was duplicated? |
oops. |
Duplicate of #8309 |
Thanks for the correction, but after reading #8309 I think these are two different errors. #8309 mentioned that this problem also exists in Chrome console, and I believe the bug was also submitted to Chrome's website. However I tested both on Chrome and Microsoft Edge (which now uses a Chromium core as well), and both of them work as intended: Interestingly, it worked different in Firefox: Therefore I believe this is a different bug. Plz look into this, thanks |
@Power-tile It's the same bug but Chromium has since migrated to an alternative REPL mode that doesn't have this issue. Node.js will too (probably), someday, once the quirks have been ironed out. |
Cool, thanks :D |
What steps will reproduce the bug?
Execution process in Powershell:

How often does it reproduce? Is there a required condition?
I tried several times and they all produce the same result.
What is the expected behavior?
I tried running the same code in the browser, and the

let a = 0
statement could successfully define the variablea
. Screenshot:What do you see instead?
When executing
let a = 0
, the environment throwsIdentifier 'a' already been declared
, as shown above.The text was updated successfully, but these errors were encountered: