History of Idiom 52 > diff from v43 to v44
Edit summary for version 44 by Vaporox:
[JS] Make use of Array.prototype.includes()
[JS] Make use of Array.prototype.includes()
↷
Version 43
2020-08-07, 19:30:53
Version 44
2020-08-07, 19:34:44
Idiom #52 Check if map contains value
Determine whether map m contains an entry with value v, for some key.
Idiom #52 Check if map contains value
Determine whether map m contains an entry with value v, for some key.
Comments bubble
Object.values converts a hashmap to a list of values.
Array#indexOf finds the first location of a value in an array, or returns -1 if the value isn't in the array.
Comments bubble
Object.values() converts a hashmap to a list of values.
Array#includes then checks whether v is included.