From 53317eae50d3e8cf4fed3de0c7871541b7de5c37 Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Mon, 7 Sep 2009 12:15:09 +0100 Subject: [PATCH] doc: port old docs for Array#clear --- src/lang/array.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lang/array.js b/src/lang/array.js index 2354aec..4c69db5 100644 --- a/src/lang/array.js +++ b/src/lang/array.js @@ -131,7 +131,16 @@ Array.from = $A; /** * Array#clear() -> Array - * Empties an array. + * + * Clears the array (makes it empty) and returns the array reference. + * + * ### Example + * + * var guys = ['Sam', 'Justin', 'Andrew', 'Dan']; + * guys.clear(); + * // -> [] + * guys + * // -> [] **/ function clear() { this.length = 0;