separate array by even and odd. Pass function into function