Skip to content

Instantly share code, notes, and snippets.

@itslenny
Last active November 7, 2018 08:50
Show Gist options
  • Save itslenny/f55727d00586de6f2f086d5147357ab4 to your computer and use it in GitHub Desktop.
Save itslenny/f55727d00586de6f2f086d5147357ab4 to your computer and use it in GitHub Desktop.
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