array-append

Append iterables to array, like Array.push().

Usage no npm install needed!

<script type="module">
  import arrayAppend from 'https://cdn.skypack.dev/array-append';
</script>

README

array-append

NOTE: array-append was renamed to @extra-array/append. NPM

Append iterables to array, like Array.push().

To append a single array, use Array.prototype.push.apply() instead.

const append = require('array-append');
// append(<array>, <iterable>...)

append([7, 15, 4], new Set([11, 18, 9, 19, 8, 14, 1]));
// [7, 15, 4, 11, 18, 9, 19, 8, 14, 1] (whats this?)
append(['l', 'o', 'r', 'd'], 'jaga', 'nnath');
// ['l', 'o', 'r', 'd', 'j', 'a', 'g', 'a', 'n', 'n', 'a', 't', 'h']
append([], new Map([['j', 10], ['e', 5], ['s', 19]]), new Map([['u', 21], ['s', 19]]));
// [['j', 10], ['e', 5], ['s', 19], ['u', 21], ['s', 19]]