doc: port old docs for Array#clear

This commit is contained in:
tjcrowder 2009-09-07 12:15:09 +01:00 committed by Tobie Langel
parent 1bdaaa5f49
commit 53317eae50
1 changed files with 10 additions and 1 deletions

View File

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