Diodes are electronic devices that restrict electric current to flow in only one direction, functioning much like a one-way valve.