@extra-array/merge.min

Merges values from sorted iterables. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:] > Similar: [sort], [merge]. > This is part of package [extra-array].

Usage no npm install needed!

<script type="module">
  import extraArrayMergeMin from 'https://cdn.skypack.dev/@extra-array/merge.min';
</script>

README

Merges values from sorted iterables. :running: :vhs: :package: :moon: :ledger:

Similar: sort, merge.
This is part of package extra-array.

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

array.merge(xs, [fc], [fm]);
// xs: iterables
// fc: compare function (a, b)
// fm: map function (v, i, x)
const array = require('extra-array');

var x = [1, 3, 5, 7];
var y = [2, 4, 8];
array.merge([x, y]);
// [
//   1, 2, 3, 4,
//   5, 7, 8
// ]

var y = [-2, -4, -8];
array.merge([x, y], (a, b) => Math.abs(a) - Math.abs(b));
// [
//   1, -2,  3, -4,
//   5,  7, -8
// ]

array.merge([x, y], null, v => Math.abs(v));
// [
//   1, -2,  3, -4,
//   5,  7, -8
// ]

references