Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JavaScript Set.prototype.isEqual shim (Set isEqual polyfill)
Set.prototype.isEqual = function(otherSet) {
if(this.size !== otherSet.size) return false;
for(let item of this) if(!otherSet.has(item)) return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment