Transform an array