Logo

Programming-Idioms

History of Idiom 52 > diff from v30 to v31

Edit summary for version 31 by programming-idioms.org:
[Elixir] Dead link: play.elixirbyexample.com has been down for a while

Version 30

2019-09-27, 09:57:27

Version 31

2019-10-14, 12:25:20

Idiom #52 Check if map contains value

Determine whether map m contains an entry with value v, for some key.

Illustration

Idiom #52 Check if map contains value

Determine whether map m contains an entry with value v, for some key.

Illustration
Extra Keywords
table dictionary hash
Extra Keywords
table dictionary hash
Code
Map.values(m) |> Enum.member?(v)
Code
Map.values(m) |> Enum.member?(v)
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Enum.html#member?/2
Doc URL
http://elixir-lang.org/docs/v1.0/elixir/Enum.html#member?/2
Demo URL
http://play.elixirbyexample.com/s/96c6f1e9fd