Hashtable (hash table) is a collection-type data structure that is directly accessed based on key-value pairs.
The query efficiency of a hash table is very high because it can be accessed directly by key.
Arrays are searched by traversing subscripts.
Normally, objects in javascript can dynamically add or delete attributes. Therefore, objects can be viewed as a set,
Javascript objects are inherently hashtable.
Construct a hashtable object as follows:
VaR hashtable = {name: "will", age: 18} // if the value is a string, it must be placed between quotation marks (single or double)
Simple hashtable object:
Value: hashtable. Name or hashtable ["name"];
Delete: delete hashtable. Name or delete hashtable ["name"]
The hashtable object can also store arrays, such as VAR hashtable = {A: [,], B: "will "};
Hashtable ["A"] can be used to operate on an array, for example, hashtable ["A"]. join () or hashtable ["A"]. sort () and so on.
* ***************************** After hashtable knowledge point from the Moon film "Return of the King" ** **************************************
******************* *********************************** *************