buildArray

inline fun <E> buildArray(builderAction: MutableList<E>.() -> Unit): Array<E>(source)

Builds a new Array by populating a MutableList using the given builderAction and returning an Array with the same elements.

The list passed as a receiver to the builderAction is valid only inside that function. Using it outside of the function produces an unspecified behavior.