Skip to content

nabokihms/incrediblehash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IncredibleHash.js

Implementation of this dirty hack:

arr = [];
arr.push('max');
arr['max'] = 'super';
console.log(arr);
//['max', 'max': 'super']
console.log(arr.length);
//1

Example:

var IncredibleHash = require('incrediblehash');

map = new IncredibleHash();
map.addToHash('max', 'super');
console.log(map.getFromHash('max'));
//'super'
console.log(map.getFromHash(0));
//'max'
console.log(map.length);
//1

It is incredible, isn't it?