Convert a nested array-like or iterable object to a flat array.