Determines if a set has a given thing.
This function does not generate a change.
set.has(thing)
Argument | Type | Description |
---|---|---|
thing | thing (required) | Thing to check. |
Returns true
if the given thing is found in the set and otherwise false
.
This code shows an example use case of has():
iris = {name: 'Iris'};
s = set(iris);
/* Check if iris is in set `s` */
s.has(iris);
Return value in JSON format
true