Both.
Bromine gains one electron in ionic compounds.
Bromine will share electron in covalent compounds.
Potassium will lose electrons when reacting with bromine. Potassium is a metal and tends to lose electrons to achieve a stable electron configuration, while bromine is a nonmetal that tends to gain electrons to achieve a stable electron configuration.
In forming compounds, atoms are engaged in either gaining or losing electrons. They may also share electrons, but that is also a form of gaining or losing electrons.
Boron can lose 3 electrons from its valence shell that is 2 in 2s & 1 in 2p sub-shell, wheras it cannot gain electron b'coz of its electropositive nature & it has less electron affinity.
Transition metals typically lose electrons when they form ions, usually from their outermost s and d orbitals. They can also share electrons when forming covalent bonds, particularly in complex ions or coordination compounds. Their ability to both lose and share electrons contributes to their versatility and varied oxidation states in chemical reactions.
In chemistry, metals are the elements that tend to lose electrons when they react to form compounds; Non-metals tend to gain electrons when they form compounds. When metals and non-metals react and exchange electrons with one another they form an ionic bond.
Bromine (Br) has 35 electrons, while Krypton (Kr) has 36 electrons. To have the same electron configuration as Krypton, Bromine would need to lose one electron.
4
Lose
Bromine, being in the second column from the rigth of the periodic table has a high electronegativity so when it forms compounds it tends to gain electrons, in other words, it is a nonmetal. While metals, which have low electronegativities tend to lose electrons
The nonmetal family of the periodic table that wants to gain, lose, or share four electrons is the carbon family or Group 14. Elements in this group have four valence electrons and can form covalent bonds by sharing these electrons, such as carbon in organic compounds.
Bromine's atomic number is 35, so it has 7 valence electrons. To achieve 8 valence electrons and a full outer shell, bromine needs to gain one electron.
Polonium can lose two or four electrons.