Skip to content
Subhajit Sahu edited this page Mar 15, 2020 · 27 revisions

Copies part of array to another.

array.copy$(x, y, [j], [i], [I]);
// x: target array (updated)
// y: source array
// j: write index (0)
// i: read start index (0)
// I: read end index (x.length)
// --> y
const array = require('extra-array');

var a = [1, 2, 3, 4, 5];
array.slice$(a, 2);
// [3, 4, 5]

a;
// [3, 4, 5]

var b = [1, 2, 3, 4, 5];
array.slice$(b, 2, 4);
// [3, 4]

b;
// [3, 4]

references

Clone this wiki locally