What is the difference between ionic compound and covalent compound?

an ionic compound is formed by loss and gain of electrons while a coalent compound is formed by mutual sharing of electrons