<script type="text/javascript"> function HashTable() { this._hashtable = {}; if (typeof (_hashtable_initialized) == "undefined") { HashTable.prototype.Add = function(key, value) { if (key in this._hashtable) { return false; } this._hashtable[key] = value; return true; } HashTable.prototype.Remove = function(key) { return delete (this._hashtable[key]); } HashTable.prototype.Count = function() { var i = 0; for (var k in this._hashtable) { i++; } return i; } HashTable.prototype.Items = function(key) { return this._hashtable[key]; } HashTable.prototype.Clear = function() { for (var k in this._hashtable) { delete this._hashtable[k]; } return true; } HashTable.prototype.Contains = function(key) { return typeof (this._hashtable[key]) != "undefined"; } _hashtable_initialized = true; } } </script>
![](https://img2024.cnblogs.com/blog/35695/202407/35695-20240713070336838-1837943664.jpg)