Design HashMap LeetCode solution in JavaScript
1var MyHashMap = function () {2this.hashMap = [];3};45/**6* @param {number} key7* @param {number} value8* @return {void}9*/10MyHashMap.prototype.put = function (key, value) {11this.hashMap[key] = [key, value];12};1314/**15* @param {number} key16* @return {number}17*/18MyHashMap.prototype.get = function (key) {19return this.hashMap[key] ? this.hashMap[key][1] : -1;20};2122/**23* @param {number} key24* @return {void}25*/26MyHashMap.prototype.remove = function (key) {27delete this.hashMap[key];28};2930/**31* Your MyHashMap object will be instantiated and called as such:32* var obj = new MyHashMap()33* obj.put(key,value)34* var param_2 = obj.get(key)35* obj.remove(key)36*/