Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3f5c99f

Browse files
authored
Function Delegates
1 parent 06d1ad9 commit 3f5c99f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,13 @@ needed.
2121
const multiply = (x, y) => x * y;
2222
console.log(multiply(5,10)) //50
2323
```
24+
25+
## Function Delegates
26+
27+
Function delegates encapsulate a method allowing functions to be composed or passed as data.
28+
29+
```javascript
30+
const isZero = n => n === 0;
31+
const a = [0,1,0,3,4,0];
32+
console.log(a.filter(isZero).length); // 3
33+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /