檢查集合中是否存在值

要檢查集合中是否存在給定值,請使用 .has() 方法:

mySet.has(someVal);

如果 someVal 出現在集合中,則返回 true,否則返回 false。