

Show HN: Sets in JavaScript - jterenzio
https://github.com/jterenzio/Set.js

======
cynwoody
I wonder if it would be quicker for getHash() to check for object (including
functions) first, then for string, then let the rest come as they are, more or
less:

    
    
        var objectId = 1000000;
    
        function getHash2(value) {
            if (typeof value === 'object' || typeof value === 'function') {
                if (value === null)
                    return 'null';
                value._hash = value._hash || ('[object ' + (objectId++) + ']');
                return value._hash;
            }
            return typeof value === 'string' ? "'" + value : value
        }

