What is the primary function of a battery?
A) To generate electricity
B) To store electrical energy
C) To regulate voltage
D) To convert mechanical energy into electrical energy