Last active
November 15, 2022 09:54
-
-
Save zlrlo/68b6f4c82bd46385f540f6d21bbcf1c6 to your computer and use it in GitHub Desktop.
javascript trick - 함수형 프로그래밍 방식 범위 루프
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
| // for (let i = 5; i < 10; i += 1) { sum += i } | |
| const sum = Array.from(new Array(5), (_, i) => i + 5).reduce((acc, cur) => acc + cur, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment