From 48a0f5a44cf04d0ae713f7e48b92880eecce260b Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Thu, 10 Sep 2009 15:18:05 +0100 Subject: [PATCH] doc: Merged and updated old docs for Hash#toObject. --- src/lang/hash.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lang/hash.js b/src/lang/hash.js index daeb729..2c40203 100644 --- a/src/lang/hash.js +++ b/src/lang/hash.js @@ -143,7 +143,15 @@ var Hash = Class.create(Enumerable, (function() { /** * Hash#toObject() -> Object * - * Returns a cloned, vanilla object. + * Returns a cloned, vanilla object whose properties (and property values) + * match the keys (and values) from the hash. + * + * ### Example + * + * var h = new Hash({ a: 'apple', b: 'banana', c: 'coconut' }); + * var obj = h.toObject(); + * obj.a; + * // -> "apple" **/ function toObject() { return Object.clone(this._object);