Electron affinity depends on
Atomic size and nuclear charge both
Electron affiity is the tendency of atom to accept electron.
It depends on atomic size and nuclear charge.
As the size increases ,it will be difficult for the atom to accept electron so electron affinity decreses.
As the nuclear charge increases ,the the tendency of atom to accept electron and hence elctron affinity increases.