| Language | Syntax |
|---|---|
| Python | lambda x: x + 1 |
| JavaScript | x => x + 1 x => { return x + 1; } |
| TypeScript | (x: number): number => { return x + 1; } |
| Java | x -> x + 1 (int x) -> { return x + 1; } |
| Kotlin | { x -> x + 1 } { x: Int -> x + 1 } |
| Swift | { $0 + 1 } { x in x + 1 } { (x: Int) -> Int in return x + 1 } |
| Rust | |x| x + 1 |
| C++ | [](int x) -> int { return x + 1; } |
| Haskell | \x -> x + 1 |
Created
November 27, 2022 09:22
-
-
Save eyelash/1b1f84071886fc9e6aecba9b76d72ffa to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment