Electron affinity may be defined as ''the energy released when an extra electron is added to a neutral gaseous atom.''
Thus, higher the energy released in the process of taking up an extra electron, the higher will be the electron affinity. Higher the value of electron affinity of an atom, the more is its tendency to change into anion.
Halogen have more tendency to change into anion. Therefore, halogens have the highest electron affinity.