instance method Hash#update

View source on GitHub →

Hash#update(object) → Hash
  • object (Object | Hash) – The object to merge with this hash to produce the resulting hash.

Updates a hash in place with the key/value pairs of object, returns the hash.

Hash#update modifies the hash. To get a new hash instead, use Hash#merge.

Example
var h = $H({one: "uno", two: "due"});
h.update({three: "tre"});
// -> h (a reference to the original hash)
h.keys();
// -> ["one", "two", "three"] (has merged contents)