what is diode ?
Diode is an electrical device which allows current to flow in only one direction... As like example our two pin mobile charger have didode so no matters how u connect in the socket because even if u connect it in the opposite direction means phase in neutral and neutral in phase then too it will charge ur mobile phone bcoz didode will allow the current to flow in onpy one direction so it can take any path out of those two pin to flow....