Nodejs Array Clear clear()

Here you can find the source of clear()

Method Source Code

/**/*from  www. j a va 2s.c  o m*/
 * clear is a method of Array to remove all element of the Array
 *
 * @return   Void
 */
Array.prototype.clear = function()
{
  this.splice(0, this.length);
};

Related

  1. 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(){
    ...
    
  2. clear()
    Array.prototype.clear = function () {
        this.length = 0;
    };
    ===?
    Array.prototype.removeAt = function (pos) {
        this.splice(pos, 1);
    };
    
  3. clear()
    Array.prototype.clear = function() {
      this.length = 0;
      return this;
    };
    
  4. clear()
    Array.prototype.clear = function () {
        for (var i = 0, a = 0; i < this.length; i++) {
            this[i] = null;
        this.length = 0;
    };
    
  5. clear()
    Array.prototype.clear = function() {
      this.length = 0;
    };
    
  6. clear()
    Array.prototype.clear = function() {
        while (this.length > 0) {
            this.pop();
    };
    
  7. clear()
    Array.prototype.clear = function() {
      this.length = 0; 
    };
    
  8. clear()
    var util = require('util');
    Array.prototype.clear = function () {
        while (this.length) {
            this.pop();
    };
    Object.mapObjectToArray = function (object) {
        var keyValuePair = [];
        Object.keys(object).map(function (key) {
    ...
    
  9. clear()
    Array.prototype.clear=function(){
        this.length=0;