How to Create Default Parameters/Arguments for a Function

From ElixirBlocks
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