allow omitting the fn for toArray
v1.2.0