Nodejs Array Clear clear()

Here you can find the source of clear()

Method Source Code

Array.prototype.clear = function() {
   this.length = 0;/*w  w w. j  a  v a2s.  c  o  m*/
   return this;
};

Related

  1. clear()
    'use strict';
    Array.prototype.clear = function() {
        this.length = 0;
    
  2. clear()
    window.onload = function(){
      test();
    Array.prototype.clear = function(){
      console.log(this.length);
      for(var i = 0;i < this.length;++i)
        this.pop();
    function test(){
    ...
    
  3. clear()
    Array.prototype.clear = function () {
        this.length = 0;
    };
    ===?
    Array.prototype.removeAt = function (pos) {
        this.splice(pos, 1);
    };
    
  4. clear()
    Array.prototype.clear = function() {
      this.length = 0;
      return this;
    };