flattery

Flattens an array of nested arrays into a list of numbers

Usage no npm install needed!

<script type="module">
  import flattery from 'https://cdn.skypack.dev/flattery';
</script>

README

Build Status

flattery

Flattens an array of nested arrays into a list of scalar elements

Instructions

Install via npm:

npm install flattery --save

Use in your Node scripts like this:

const flattery = require('flattery');

var flattened = flattery([[1, 2, [3]], 4]); // -> [1, 2, 3, 4]

License

MIT

Copyright (c) Claudio Procida 2015