Logo

Programming-Idioms

History of Idiom 51 > diff from v36 to v37

Edit summary for version 37 by dgd:
New Scala implementation by user [dgd]

Version 36

2019-09-26, 14:20:03

Version 37

2019-09-26, 15:57:46

Idiom #51 Check if map contains key

Determine whether map m contains an entry for key k

Illustration

Idiom #51 Check if map contains key

Determine whether map m contains an entry for key k

Illustration
Extra Keywords
table dictionary hash
Extra Keywords
table dictionary hash
Code
def contains[K](map: Map[K, _], key: K): Boolean =
  map.contains(key)