Here you can find the source of clear()
Array.prototype.clear = function () { this.length = 0;//from w ww . j a va 2 s.c o m return this; }; // Arr.clear();
;(function(){ Array.prototype.clear = function() { for(var i=0,l=this.length;i<l;i++) { var r = this.pop(); if(typeof(r)=='object') if(r.constructor.name=='Array') r = r.clear(); else if('clear' in r) r = r.clear(); ...
Array.prototype.clear = function(){
this.length = 0;
};
Array.prototype.clear=function(){
this.length=0;
Array.prototype.clear = function() { return this.splice(0,this.length); };
Array.prototype.clear = Array.prototype.clear || function() {
this.length = 0;
};
Array.prototype.clear = function(){
this.splice(0, this.length);
Array.prototype.Clear = function()
this.splice( 0, this.length );
};