You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/06-function-object/article.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -334,20 +334,20 @@ Caracteristica "nume intern" descrisă aici este disponibilă doar pentru Functi
334
334
Uneori, atunci când avem nevoie de un nume intern fiabil, acesta este motivul pentru a rescrie o Function Declaration sub forma unei Named Function Expression.
335
335
```
336
336
337
-
## Summary
337
+
## Sumar
338
338
339
-
Functions are objects.
339
+
Funcțiile sunt obiecte.
340
340
341
-
Here we covered their properties:
341
+
Aici am acoperit proprietățile acestora:
342
342
343
-
-`name` -- the function name. Usually taken from the function definition, but if there's none, JavaScript tries to guess it from the context (e.g. an assignment).
344
-
-`length` -- the number of arguments in the function definition. Rest parameters are not counted.
343
+
-`name` -- numele funcției. De obicei este preluat din definiția funcției, dar dacă nu există, JavaScript încearcă să îl ghicească din context (e.g. o atribuire).
344
+
-`length` -- numărul de argumente din definiția funcției. Parametrii rest nu sunt numărați.
345
345
346
-
If the function is declared as a Function Expression (not in the main code flow), and it carries the name, then it is called a Named Function Expression. The name can be used inside to reference itself, for recursive calls or such.
346
+
Dacă funcția este declarată ca o Function Expression (nu în fluxul principal de cod), și poartă numele, atunci se numește Named Function Expression. Numele poate fi utilizat în interiorul funcției pentru a se referi la ea însăși, pentru apeluri recursive sau așa ceva.
347
347
348
-
Also, functions may carry additional properties. Many well-known JavaScript libraries make great use of this feature.
348
+
De asemenea, funcțiile pot purta proprietăți suplimentare. Multe biblioteci JavaScript bine cunoscute utilizează foarte bine această caracteristică.
349
349
350
-
They create a "main" function and attach many other "helper" functions to it. For instance, the[jQuery](https://jquery.com)library creates a function named `$`. The[lodash](https://lodash.com)library creates a function `_`, and then adds`_.clone`, `_.keyBy`and other properties to it (see the [docs](https://lodash.com/docs)when you want to learn more about them). Actually, they do it to lessen their pollution of the global space, so that a single library gives only one global variable. That reduces the possibility of naming conflicts.
350
+
Acestea creează o funcție "principală" și îi atașează multe alte funcții "ajutătoare". De exemplu, biblioteca[jQuery](https://jquery.com)creează o funcție numită `$`. Biblioteca[lodash](https://lodash.com)creează o funcție `_`, apoi îi adaugă`_.clone`, `_.keyBy`și alte proprietăți (consultați [docs](https://lodash.com/docs)când doriți să aflați mai multe despre acestea). De fapt, o fac pentru ași diminua poluarea spațiului global, astfel încât o singură bibliotecă să ofere o singură variabilă globală. Asta reduce posibilitatea apariției conflictelor de denumire.
351
351
352
352
353
-
So, a function can do a useful job by itself and also carry a bunch of other functionality in properties.
353
+
Așadar, o funcție poate face o treabă utilă de una singură și de asemenea poartă o mulțime de alte funcționalități în proprietăți.
0 commit comments