Skip to content

Commit cded230

Browse files
committed
translated until line 19
1 parent e6c4e87 commit cded230

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

1-js/06-advanced-functions/03-closure/article.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11

2-
# Variable scope, closure
2+
# Sfera variabilei, closure
33

4-
JavaScript is a very function-oriented language. It gives us a lot of freedom. A function can be created at any moment, passed as an argument to another function, and then called from a totally different place of code later.
4+
JavaScript este un limbaj foarte orientat spre funcții. Acesta ne oferă o mare libertate. O funcție poate fi creată în orice moment, transmisă ca argument unei alte funcții, și ulterior apelată dintr-un cu totul alt loc din cod.
55

6-
We already know that a function can access variables outside of it ("outer" variables).
6+
Știm deja că o funcție poate accesa variabile din afara ei (variabile "exterioare").
77

8-
But what happens if outer variables change since a function is created? Will the function get newer values or the old ones?
8+
Dar ce se întâmplă dacă variabilele exterioare se schimbă de la crearea unei funcții? Va primi funcția valorile mai noi sau pe cele vechi?
99

10-
And what if a function is passed along as an argument and called from another place of code, will it get access to outer variables at the new place?
10+
Și dacă o funcție este transmisă ca argument și apelată dintr-un alt loc din cod, va avea acces la variabilele exterioare din noul loc?
1111

12-
Let's expand our knowledge to understand these scenarios and more complex ones.
12+
Haideți să ne extindem cunoștințele pentru a înțelege aceste scenarii și altele mai complexe.
1313

14-
```smart header="We'll talk about `let/const` variables here"
15-
In JavaScript, there are 3 ways to declare a variable: `let`, `const` (the modern ones), and `var` (the remnant of the past).
14+
```smart header="Vom vorbi despre variabilele `let/const` aici"
15+
În JavaScript, există 3 moduri de a declara o variabilă: `let`, `const` (cele moderne) și `var` (rămășița trecutului).
1616

17-
- In this article we'll use `let` variables in examples.
18-
- Variables, declared with `const`, behave the same, so this article is about `const` too.
19-
- The old `var` has some notable differences, they will be covered in the article <info:var>.
17+
- În acest articol vom folosi variabilele `let` în exemple.
18+
- Variabilele, declarate cu `const`, se comportă la fel, așa că acest articol se referă și la `const`.
19+
- Vechiul `var` are câteva diferențe notabile, acestea vor fi acoperite în articolul <info:var>.
2020
```
2121
2222
## Code blocks

0 commit comments

Comments
 (0)