Write an algorithm to flatten an arbitrarily nested array of values.
[ 1, [ 2, [ 3 ] ], 4 ] -> [ 1, 2, 3, 4 ]
If your language of choice includes a flattening function, please implement your own.
This kata was developed used node v17.3.0.
Jest framework was used in this repository to test the code. To run it, execute
$ npm test
If you prefer watch mode, you can run
$ npm run t-watch