Answer and explanation:
Ionic compounds are formed by elements with a considerable electronegativity difference. They are typically composed by an element of groups IA or IIA of the Periodic Table (with lower electronegativity, so it tends to lose electrons) and a other element of groups VIA or VIIA (with higher electronegativity, thus it tends to gain electrons). For example, KCl is formed by K (group IA), which loses one electron and forms the cation K⁺, and Cl (group VIIA) which gains the electron and forms the anion Cl⁻.