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

Document error at structure #3713

Open
bd1354 opened this issue Jul 9, 2024 · 1 comment
Open

Document error at structure #3713

bd1354 opened this issue Jul 9, 2024 · 1 comment

Comments

@bd1354
Copy link

bd1354 commented Jul 9, 2024

https://javascript.info/structure at this page it says that;
alert("Hello")

[1, 2].forEach(alert);
if you remove semicolon at the first line of code that causes error but I got no error It worked without problem

@joaquinelio
Copy link
Member

Can't be.

Maybe your environment hide the error?
Does it show hello then 1 then 2 ?

It must get error as the engine should interpret as

alert("Hello")[1, 2].forEach(alert)

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

2 participants