Make an array of arrays into a single array (or set, or list...)


I have the following array : {{borderlines},{loriners},{resolver,solderer},{orderlies},{blinders,brindles}}

and would like to get a single array with all the items {borderlines, loriners, resolver,solderer,orderlies,blinders,brindles}.

The order of items in the final array is not important.

I know how to do it with “repeat” statements, but I am sure there is a better way (especially when the number of items involved is much greater than in the example here above).

Any idea ?

Thanks in advance,


if the number of levels is one you can use this

set theArray to current application's NSArray's arrayWithArray:{{"borderlines"},{"loriners"},{"resolver","solderer"},{"orderlies"},{"blinders","brindles"}}
       set flattenedArray to theArray's valueForKeyPath:"@unionOfArrays.self"

Thanks !