Creating a constant time data structure for DOM element references
<p><a href="http://stackoverflow.com/questions/881768/what-is-the-unique-identifier-for-a-dom-element-node">Relevant discussion</a>. </p>

<p>I understand I can build an array of references to elements/nodes. I realize also that I could use the neat trick of treating an array like a heap (index <code>2n</code> and <code>2n+1</code> for children) to build a (potentially wasteful) binary search tree using it. </p>

<p>But all that's still not enough for the premature optimizer in me. Besides, implementing a BST is going to be bug prone. </p>

<p>Here's my question. Can I somehow use an element reference as index into javascript's hashes (which are objects, or vice versa?). If not, can I conjure up a unique string from an element reference, which I can then use as my hash key? If not, how the hell does jQuery do it? </p>
