funcifyr.js
function(x, fn) {
        if (Array.isArray(x) ) {
          return x.reduce(function(acc, curr) {
            return acc.concat( funcifyr.flatMap(curr, fn) );
          }, []);
        }
        return fn(x);
      }
function(x, fn) {
        if (Array.isArray(x) ) {
          return x.reduce(function(acc, curr) {
            return acc.concat( funcifyr.flatMap(curr, fn) );
          }, []);
        }
        return fn(x);
      }
function ( x , fn ) { if ( Array . isArray ( x ) ) { return x . reduce ( function ( acc , curr ) { return acc . concat ( funcifyr . flatMap ( curr , fn ) ) ; } , [ ] ) ; } return fn ( x ) ; }
Takes a multidimensional array and a callback function, and returns a new, flattened array with the
results of calling the callback function on each value.

flatMap :: ([a, [b, [c, d]]], fn) → [a, b, c, d]

@param (x, fn) - A multidimensional array and a callback function
@returns array
Takes a multidimensional array and a callback function and returns a new flattened array with the results of calling the callback function on each value .