instance method Hash#set

View source on GitHub →

Hash#set(key, value) → value
  • key (String) – The key to use for this value.
  • value (?) – The value to use for this key.

Stores value in the hash using the key key and returns value.

Example
var h = $H();
h.keys();
// -> [] (initially empty)
h.set('a', 'apple');
// -> "apple"
h.keys();
// -> ["a"] (has the new entry)
h.get('a');
// -> "apple"