hi
the ‘isSubsetOf’ method is some kind of lengthy
it may be clear like following
isSubsetOf(otherSet) {
if (this.size() > otherSet.size()) {
return false;
}
return this.values().every(value => otherSet.has(value));
}
or remain 'isSubset' variable
const isSubset = this.values().every(value => otherSet.has(value));
return isSubset;