Logo

Programming-Idioms

History of Idiom 52 > diff from v36 to v37

Edit summary for version 37 by programming-idioms.org:
[Elixir] 404

Version 36

2020-04-26, 17:37:20

Version 37

2020-05-10, 21:57:16

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
Variables
m,v
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
https://hexdocs.pm/elixir/Enum.html#member?/2