From 64cd05dd599b4a6aae4a08a987bad0ed7b429b4b Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Thu, 10 Sep 2009 15:15:36 +0100 Subject: [PATCH] doc: Fleshed out docs for Hash#toJSON. --- src/lang/hash.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lang/hash.js b/src/lang/hash.js index f0ce359..daeb729 100644 --- a/src/lang/hash.js +++ b/src/lang/hash.js @@ -262,7 +262,13 @@ var Hash = Class.create(Enumerable, (function() { /** related to: Object.toJSON * Hash#toJSON() -> String * - * Returns a JSON string. + * Returns a JSON string containing the keys and values in this hash. + * + * ### Example + * + * var h = $H({'a': 'apple', 'b': 23, 'c': false}); + * h.toJSON(); + * // -> {"a": "apple", "b": 23, "c": false} **/ function toJSON() { return Object.toJSON(this.toObject());