Show HN: Sets in JavaScript
github.com
github.com
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
}