Places a separator between every value.
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 ]