@extra-array/intersperse

Places a separator between every value.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-array/intersperse
1402.10.197 months ago2 years agoMinified + gzip package size for @extra-array/intersperse in KB

Readme

Places a separator between every value. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
Similar: interleave, intermix, interpolate, intersperse.

This is part of package extra-array.



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 ]



References