Created
April 10, 2018 19:43
-
-
Save opensussex/0f3ddc4c2b69fb4c90f9710d8d96085a to your computer and use it in GitHub Desktop.
example of some elixir anonymous function
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
apply_tax = fn price -> tax = (price * 0.12); total = price + tax;IO.puts "Price: #{total} - Tax: #{tax}" end; | |
Enum.each [12.5, 30.99, 250.49, 18.80], apply_tax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment