-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
ES6에서의 예제가 이해가 되지 않음
- ES6
{
function foo () { return 1 }
foo() === 1
{
function foo () { return 2 }
foo() === 2
}
foo() === 1
}
- ES5
[source, javascript]
// only in ES5 with the help of block-scope emulating
// function scopes and function expressions
(function () {
var foo = function () { return 1; }
foo() === 1;
(function () {
var foo = function () { return 2; }
foo() === 2;
})();
foo() === 1;
})();
Metadata
Metadata
Assignees
Labels
No labels