Created
January 3, 2025 19:43
-
-
Save todashuta/6a4a044527737a5ceeeb7f0710c9bd33 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
| func add(_ x: Int) -> ((Int) -> Int) { | |
| return { (_ y: Int) -> Int in | |
| return x + y | |
| } | |
| } | |
| add(1)(2) == 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment