doc: Merged and updated old docs for Hash#unset.

This commit is contained in:
tjcrowder 2009-09-10 15:39:34 +01:00
parent da402268ac
commit 71e07f0efa
1 changed files with 12 additions and 1 deletions

View File

@ -132,7 +132,18 @@ var Hash = Class.create(Enumerable, (function() {
/**
* Hash#unset(key) -> value
*
* Deletes the hash's `key` property and returns its 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)
**/
function unset(key) {
var value = this._object[key];