Skip to content

Instantly share code, notes, and snippets.

@SoftwareDevPro
Created October 30, 2016 05:33
Show Gist options
  • Save SoftwareDevPro/359883965101ab6730ab351ef9e5426f to your computer and use it in GitHub Desktop.
Save SoftwareDevPro/359883965101ab6730ab351ef9e5426f to your computer and use it in GitHub Desktop.
Implementation of hash code for the Object prototype
# 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