@extra-array/intermix.min
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

Places values of an array between another. 📦 😺 🏃 📼 🌔 📜 📰 📘

Similar: interleave, intermix, interpolate, intersperse.

This is part of package extra-array.

This is browserified, minified version of @extra-array/intermix.
It is exported as global variable array_intermix.
CDN: unpkg, jsDelivr.


array.intermix(x, y, [m], [n], [s], [t]);
// x: an array
// y: another array
// m: number of values from x (1)
// n: number of values from y (1)
// s: step size for x (m)
// t: step size for y (n)
const array = require("extra-array");

var x = [1, 2, 3, 4];
var y = [10, 20, 30];
array.intermix(x, [10]);
// [ 1, 10, 2, 10, 3, 10, 4 ]

array.intermix(x, y);
// [ 1, 10, 2, 20, 3, 30, 4 ]

array.intermix(x, y, 2);
// [ 1, 2, 10, 3, 4 ]

array.intermix(x, y, 1, 2);
// [ 1, 10, 20, 2, 30, 10, 3, 20, 30, 4 ]


References

Readme

Keywords

Package Sidebar

Install

npm i @extra-array/intermix.min

Weekly Downloads

4

Version

2.10.19

License

MIT

Unpacked Size

6.11 kB

Total Files

8

Last publish

Collaborators

  • wolfram77