setItem
Class
Method of Hash
Library
hash.js
Syntax
exampleHash.setItem(key, value);
Parameters
key A string indicating the key for the new item in the associative array.
value Whatever you want to store in that Hash position.
Description
Sets the value of the item in the Hash with that key to the desired value. Adds a new item if the key does not exist.
Examples
In the example below the Hash
badSciFi will end up with three items in it.
var badSciFi = new Hash();
badSciFi.setItem("Connery", "Zardoz");
badSciFi.setItem("York", "Logan's Run");
badSciFi.setItem("Douglas", "Saturn 3");