Chlorine is a halogen, located in group 17 of the periodic table.
Halogens have 7 valence electrons and tend to gain one electron to achieve a stable noble gas configuration (8 valence electrons). When an atom gains an electron, it becomes negatively charged because it now has more electrons than protons.
A negatively charged ion is called an anion. When an atom loses an electron, it becomes positively charged because it now has fewer electrons than protons. A positively charged ion is called a *cation*.
Since chlorine gains an electron to become stable, it becomes an anion.
Resonance in X$_2$Y can be represented as
The enthalpy of formation of X$_2$Y is 80 kJ mol$^{-1}$, and the magnitude of resonance energy of X$_2$Y is: