Created
October 30, 2016 05:33
-
-
Save SoftwareDevPro/359883965101ab6730ab351ef9e5426f to your computer and use it in GitHub Desktop.
Implementation of hash code for the Object prototype
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
# Filed under: 140bytes, identifier, object, id, hashcode | |
# Gives every object a unique ID. | |
(() -> | |
Object.prototype.getHashCode = ((i) -> | |
i = 0 | |
() -> | |
if this.h = this.h then this.h else i++ | |
)() | |
return | |
)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment