1. A method of inverting an ON/OFF polarity of an electrically actuated switch comprising a first electrode, a second electrode; and an active region disposed therebetween, said active region comprising a primary active region comprising at least one material for transporting and hosting ions that act as dopants to control the flow of electrons through the switch, and a secondary active region comprising at least one material for providing a source/sink of ionic dopants for said at least one primary active region, said method comprising performing at least one of the following steps at least once: if said ON/OFF polarity of said switch is such that impressing a positive bias to said second electrode turns said switch ON, then a positive bias is applied to said second electrode for a long enough time to cause all positive dopants to drift to said first electrode in which case said ON/OFF polarity of said switch is inverted and it will turn ON when applying a negative bias to said second electrode; if said ON/OFF polarity of said switch is such that impressing a negative bias to said second electrode turns said switch ON, then a negative bias is applied to said second electrode for a long enough time to cause all positive dopants to drift to said second electrode, in which case said ON/OFF polarity of said switch is inverted and it will turn ON when applying a positive bias to said second electrode.