Skip to content

Commit 569b237

Browse files
committed
translated until line 43
1 parent ff1b78d commit 569b237

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

1-js/99-js-misc/03-currying-partials/article.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Vom crea o funcție ajutătoare `curry(f)` care realizează currying pentru o fu
1717

1818
```js run
1919
*!*
20-
function curry(f) { // curry(f) does the currying transform
20+
function curry(f) { // curry(f) face transformarea currying
2121
return function(a) {
2222
return function(b) {
2323
return f(a, b);
@@ -26,7 +26,7 @@ function curry(f) { // curry(f) does the currying transform
2626
}
2727
*/!*
2828

29-
// usage
29+
// utilizare
3030
function sum(a, b) {
3131
return a + b;
3232
}
@@ -36,11 +36,11 @@ let curriedSum = curry(sum);
3636
alert( curriedSum(1)(2) ); // 3
3737
```
3838

39-
As you can see, the implementation is straightforward: it's just two wrappers.
39+
După cum puteți vedea, implementarea este directă: este vorba doar de două wrappere.
4040

41-
- The result of `curry(func)` is a wrapper `function(a)`.
42-
- When it is called like `curriedSum(1)`, the argument is saved in the Lexical Environment, and a new wrapper is returned `function(b)`.
43-
- Then this wrapper is called with `2` as an argument, and it passes the call to the original `sum`.
41+
- Rezultatul lui `curry(func)` este un wrapper `function(a)`.
42+
- Atunci când este apelat ca `currySum(1)`, argumentul este salvat în mediul lexical și se returnează un nou wrapper `function(b)`.
43+
- Apoi, acest wrapper este apelat cu `2` ca argument, iar apelul este transmis către `sum` original.
4444

4545
More advanced implementations of currying, such as [_.curry](https://lodash.com/docs#curry) from lodash library, return a wrapper that allows a function to be called both normally and partially:
4646

0 commit comments

Comments
 (0)