docs: function flatten(arr) {
      return arr.reduce(function (flat, toFlatten) {
          // See if this index is an array that itself needs to be flattened.
          if(toFlatten.some && toFlatten.some(Array.isArray)) {
              return flat.concat(flatten(toFlatten));
              // Otherwise just add the current index to the end of the flattened array.
          } else {
              return flat.concat(toFlatten);
          }
      }, []);
  }