Prototype This page is part of the Prototype JavaScript framework documentation.
Overview | (...)

The Prototype Array.prototype.clear function empties an array and returns itself.

Syntax


  arr = [47, 11];
  arr.clear(); 
  alert(arr.length);  // returns 0, the new length of the empty array.