Clear an array with splice - Node.js Array

Node.js examples for Array:Array Operation

Description

Clear an array with splice

Demo Code


Array.prototype.clear = function() {

    return this.splice(0, this.length);
};

Related Tutorials