Created
January 19, 2019 23:21
-
-
Save Tombarr/d7697e2d8f907970417dd63dc477fb6b to your computer and use it in GitHub Desktop.
Default function arguments in Elixir
This file contains 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
def add_ten(x \\ 10) do | |
x + 10 | |
end | |
add_ten() # 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment