Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 9: Add example for iterating through a list of maps #8

Open
radar opened this issue Jul 25, 2017 · 0 comments
Open

Chapter 9: Add example for iterating through a list of maps #8

radar opened this issue Jul 25, 2017 · 0 comments

Comments

@radar
Copy link
Owner

radar commented Jul 25, 2017

Having an example like:

people = [%{"name" => "The Author", "age" => "30"}, %{"name" => "The Reader", "age" => "40"}]
Enum.map(people, fn (person) -> person["name"] end)

Would be an excellent example to use in Chapter 9 when demonstrating Enum.map with maps. Might be able to show the shorter ampersand syntax here too:

Enum.map(people, &(&1["name"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant