Created
November 11, 2019 13:21
-
-
Save ramazankanbur/14e79667a2db556946a602d600bc283a 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 numbers = [1,2,3,4]; | |
| var doubledArray = numbers.map(function(number){ | |
| return 2 * number; | |
| }); | |
| console.log(doubledArray); | |
| //Yukarıdaki fonksiyon ile aynı işi yapan daha yalın tanımlama | |
| var doubledArray = numbers.map(number => 2 * number); | |
| console.log(doubledArray); | |
| //output | |
| [2, 4, 6, 8] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment