Clear array element - Node.js Array

Node.js examples for Array:Clear

Description

Clear array element

Demo Code


Array.prototype.clear = function() {
  while(this.length>0) {
    this.pop();//from w  w w .ja v  a  2s .c  o  m
  }
};

Related Tutorials