flatiteris just the type of the iterator object returned flat( docs ). So, all you need to know about this is that it is an iterator, like any other.
Obviously, it flattenconsumes more memory and processor, as it creates a new array, while it flatcreates an iterator object, which is very fast.
If you only need to iterate over the array, use flat.
If you need an actual flat array (for purposes other than explicitly iterating over it), use flatten.
source
share