instance method Hash#unset

View source on GitHub →

Hash#unset(key) → value

Deletes the stored pair for the given key from the hash and returns its value.

Example
var h = new Hash({a: 'apple', b: 'banana', c: 'coconut'});
h.keys();
// -> ["a", "b", "c"]
h.unset('a');
// -> 'apple'
h.keys();
// -> ["b", "c"] ("a" is no longer in the hash)