Skip to content

Commit 96568bf

Browse files
authored
Update article.md
1 parent 168a08a commit 96568bf

File tree

1 file changed

+3
-3
lines changed
  • 1-js/06-advanced-functions/07-new-function

1 file changed

+3
-3
lines changed

1-js/06-advanced-functions/07-new-function/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Porém quando uma função é criada usando `new Function`, a sua `[[Environment
5353
```js run
5454

5555
function 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
7171
function 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

8484
Essa caracteristica especial de `new Function` parece estranha, mas se apresenta muito útil na prática.

0 commit comments

Comments
 (0)