Exchanges all keys with their associated values in an array