Created
April 15, 2015 14:16
-
-
Save restorer/7a9d693e0f3ecd29ffea to your computer and use it in GitHub Desktop.
HashMap for javascript target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://kangax.github.io/compat-table/es5/#Object.create | |
var HashMap = function() {} | |
HashMap.prototype = Object.create(null); | |
var map = new HashMap(); | |
map.__proto__ = '__proto__ value'; | |
map.hasOwnProperty = 'hasOwnProperty value'; | |
map.prototype = 'prototype value'; | |
map.toString = 'toString value'; | |
for (var key in map) { | |
console.log('key=[' + key + '] value=[' + map[key] + ']'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment