implemented value-selector support for toArray()