How to Create Default Parameters/Arguments for a Function: Difference between revisions

From ElixirBlocks
Jump to: navigation, search
(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>")
 
(No difference)

Latest revision as of 09:23, 13 October 2023

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

 def x(item \\ %{})do   

     item   # default argument of %{}
 end