Insert element to Array by index - Node.js Array

Node.js examples for Array:Insert

Description

Insert element to Array by index

Demo Code


Array.prototype.insert = function (index, item) {
    this.splice(index, 0, item);// ww w.j a va 2  s  .co m
};

Related Tutorials