Last active
November 7, 2018 08:50
-
-
Save itslenny/f55727d00586de6f2f086d5147357ab4 to your computer and use it in GitHub Desktop.
JavaScript Set.prototype.isEqual shim (Set isEqual polyfill)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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