2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Introduction to Currying and Partial Application
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Introduction to Currying and Partial Application
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```javascript
|
2018-10-12 15:37:13 -04:00
|
|
|
function add(x) {
|
|
|
|
// Add your code below this line
|
|
|
|
return function(y) {
|
|
|
|
return function(z) {
|
|
|
|
return x + y + z;
|
2019-07-24 00:59:27 -07:00
|
|
|
};
|
|
|
|
};
|
2018-10-12 15:37:13 -04:00
|
|
|
// Add your code above this line
|
|
|
|
}
|
|
|
|
add(10)(20)(30);
|
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
</details>
|