Skip to content

Instantly share code, notes, and snippets.

@Tombarr
Created January 19, 2019 23:21
Show Gist options
  • Save Tombarr/d7697e2d8f907970417dd63dc477fb6b to your computer and use it in GitHub Desktop.
Save Tombarr/d7697e2d8f907970417dd63dc477fb6b to your computer and use it in GitHub Desktop.
Default function arguments in Elixir
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