Skip to content
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

57 - is wrong answer #776

Open
mg901 opened this issue Mar 17, 2024 · 2 comments
Open

57 - is wrong answer #776

mg901 opened this issue Mar 17, 2024 · 2 comments

Comments

@mg901
Copy link

mg901 commented Mar 17, 2024

Hi, Lydia. Thank you for your remarkable repo.)

I tried executing the example in a sandbox on Stackblitz.com and discovered the answer C is wrong. The right answer is B. You can see it here.

@alexandercerutti
Copy link

alexandercerutti commented Mar 17, 2024

@mg901 as I was suspecting, Stackblitz transpiles your code before executing it. It transpiles by using an implementation of CommonJS require().

So, it doesn't actually use ESM modules. To check it, just open the project outside Stackblitz editor: https://js-w9nxee.stackblitz.io/

By opening the devtools, you can see the files.

If you run it on a Node project on local, with "type": "module" in package.json, the answer C is correct:

immagine

@tsotneforester
Copy link

In browser environment I get "Assignment to constant variable", not 11. The point is reassign imported variable and then make changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants