哈希映射
Hash Map 的簡單實現
//定義一個Hash Map var hashMap={ Set : function(key,value){this[key] = value}, Get : function(key){return this[key]}, Contains : function(key){return this.Get(key) == null?false:true}, Remove : function(key){delete this[key]} } ? //設置hashMap鍵值 hashMap.Set("name","bonly"); hashMap.Set("age","24"); ? //獲取hashMap值 hashMap.Get("name");//bonly hashMap.Contains("title");//false hashMap.Contains("name");//true hashMap.Remove("age"); |
轉載于:https://www.cnblogs.com/bonly-ge/p/7076457.html
總結
- 上一篇: PostgreSQL安装和简单配置
- 下一篇: 你会等待还是离开(大理)---写的一个推