contains
check if a dict has a given value, or a list has a given element
(any xs, any x) -> boolean
If xs
is a dict, returns whether x
is a value in xs
.
If xs
is a list, returns whether x
is an element in xs
.
Returns nil
if xs
is nil
.
Throws an error if xs
is not a list or dict.
Parameters
Name | Type | Description |
---|---|---|
xs |
dict or list | The dict or list to check |
x |
string or long | The element to look for |