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

Block-Scoped Functions code is wrong. #16

Closed
webbedspace opened this issue Apr 8, 2015 · 1 comment
Closed

Block-Scoped Functions code is wrong. #16

webbedspace opened this issue Apr 8, 2015 · 1 comment

Comments

@webbedspace
Copy link

This is wrong. That code depicts function-scoped functions. It should actually be this:

{
    function foo() {...}
    foo();
    {
        function bar() {...}
        bar();
    }
}

ES5:

function foo() {...}
function bar() {...}
{
    foo();
    {
        bar();
    }
}
@rse
Copy link
Owner

rse commented Apr 8, 2015

Good catch. Thanks for the hint. I've revised the stuff and now showcase both Function-Scoped Functions and Block-Scoped Functions. How it is correct now.

@rse rse closed this as completed Apr 8, 2015
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