@extra-array/intersperse.min
v2.10.19
Published
Places a separator between every value.
Downloads
19
Readme
Places a separator between every value. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
Similar: interleave, intermix, interpolate, intersperse.
This is part of package extra-array.
This is browserified, minified version of @extra-array/intersperse. It is exported as global variable array_intersperse. CDN: unpkg, jsDelivr.
array.intersperse(x, v);
// x: an array
// v: separator
const array = require("extra-array");
var x = [1, 2, 3];
array.intersperse(x, 10);
// [ 1, 10, 2, 10, 3 ]
var x = [1, 2, 3, 4];
array.intersperse(x, 10);
// [ 1, 10, 2, 10, 3, 10, 4 ]