Last active
October 20, 2018 11:48
-
-
Save mkczarkowski/aa14615c09075ba2ef50586249920536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const array = [1, 2, 3, 4, 5, 6]; | |
| // Rozwiązanie z użyciem deklaracji funkcji. | |
| function isEven(num) { | |
| return num % 2 === 0; | |
| } | |
| function square(num) { | |
| return num * num; | |
| } | |
| const squareOfEvens = array.filter(isEven).map(square); | |
| // Rozwiązanie z wykorzystaniem funkcji strzałkowych. | |
| const isEven = num => num % 2 === 0; | |
| const square = num => num * num; | |
| const squareOfEvens = array.filter(isEven).map(square); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment