doc: Fleshed out docs for Hash#toJSON.

This commit is contained in:
tjcrowder 2009-09-10 15:15:36 +01:00
parent 62a3c8fb38
commit 64cd05dd59
1 changed files with 7 additions and 1 deletions

View File

@ -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());