code: function flatten(array, shallow) {
  
    shallow = shallow || false;
  
    if(!isArray(array)) {
      return array;
    }
  
    return (!shallow) ? depthFlatten(array, 0) :
      [].concat.apply([], array);
  }
docs: @name flatten
  @kind function
  
  @description
  Flattens a nested array (the nesting can be to any depth).
  If shallow, the array will only be flattened a one level