1// Simple ECMA5 hash table
2Hash = function(oSource){
3 for(sKey in oSource) if(Object.prototype.hasOwnProperty.call(oSource, sKey)) this[sKey] = oSource[sKey];
4};
5Hash.prototype = Object.create(null);
6
7var oHash = new Hash({foo: 'bar'});
8oHash.foo === 'bar'; // true
9oHash['foo'] === 'bar'; // true
10oHash['meow'] = 'another prop'; // true
11oHash.hasOwnProperty === undefined; // true
12Object.keys(oHash); // ['foo', 'meow']
13oHash instanceof Hash; // true
1var myHash = {}; // New object
2myHash['one'] = [1,10,5];
3myHash['two'] = [2];
4myHash['three'] = [3, 30, 300];