Ionic compounds are formed when an atom $\ce{A}$ donates one of it's electron to another atom $\ce{B}$ to form an ionic compound $\ce{A+B-}$. This is significantly more likely to happen as the electronegativity difference of $\ce{A}$ and $\ce{B}$ increases.
Hydrogen has a Pauling electronegativity of $2.20$. So, it appears to me that $\ce{H_2}$ should be able to form ionic bonds both as $$\ce{H+ + A- -> H+A-}$$ $$\ce{B+ + H- -> B+H-}$$
What are compounds that contain $\ce{H-}$ called and what are some examples?