A diode is a semiconductor device that allows current to flow in one direction only, often used for rectification in electronic circuits.