Clojure's function
interpose
in JavaScript
$ npm install --save interposejs
const interpose = require('interposejs');
interpose(0, [1, 2, 3]) // [1, 0, 2, 0, 3]
// also support array-like objects
interpose('x', 'abc') // [ 'a', 'x', 'b', 'x', 'c' ]
sep is the separator, arr is an array
or array-like objects
.
MIT © JIANG Di