How to Create Default Parameters/Arguments for a Function

From ElixirBlocks
Revision as of 09:23, 13 October 2023 by Admin (talk | contribs) (Created page with " The two backslash characters are used to create default parameters/arguments in a function. <source> def x(item \\ %{})do item # default argument of %{} end </source>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The two backslash characters are used to create default parameters/arguments in a function.

 def x(item \\ %{})do   

     item   # default argument of %{}
 end