If I type
}{
in the console of Firefox or Chrome, the result is undefined, not a SyntaxError.
This construction return undefined (construction like }!{ return false). What is the reason for such behavior?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you enter
debugger;in the console, a break point shows up, which reveals the answer:In Chrome’s developer tools, the input is wrapped inside a
withblock, then literally evaluated. So, when you put in}{, the following is evaluated:This is an empty
withblock, followed by an empty block.Exercise to reader: Try
}for(;;){