File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
1-js/06-advanced-functions/07-new-function Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ Porém quando uma função é criada usando `new Function`, a sua `[[Environment
5353``` js run
5454
5555function getFunc () {
56- let value = " test " ;
56+ let value = " teste " ;
5757
5858* ! *
5959 let func = new Function (' alert(value)' );
@@ -69,7 +69,7 @@ Compare-a com o comportamento padrão:
6969
7070``` js run
7171function getFunc () {
72- let value = " test " ;
72+ let value = " teste " ;
7373
7474* ! *
7575 let func = function () { alert (value); };
@@ -78,7 +78,7 @@ function getFunc() {
7878 return func;
7979}
8080
81- getFunc ()(); // *!*"test "*/!*, do escopo léxico de getFunc
81+ getFunc ()(); // *!*"teste "*/!*, do escopo léxico de getFunc
8282```
8383
8484Essa caracteristica especial de ` new Function ` parece estranha, mas se apresenta muito útil na prática.
You can’t perform that action at this time.
0 commit comments