Light had long been considered to be wavelike, but the photoelectric effect showed light to have particle properties. Conversely, electrons were thought of as particles but the electron diffraction experiment showed then to have wave properties.
In fact, it is thought that all photons or electromagnetic waves have particle properties and all particles and collections of particles have wave properties. This is wave particle dualities: waves are simultaneously waves and particles and particles are simultaneously particles and waves.
The equation that expresses wave particle duality is the de Broglie equation
wherethe momentum, is a property of particles
the wavelength, is a property of waves.
and is called Planck's constant.
We are used to thinking of particles as little billiard balls, with a precise size and position in space, but waves are spread out and transitory, and cannot be said to have a defined position. Conversely, light was through to occupy an infinite train, to be spread out over all of space, but light can only have particle properties if light photons are localised. In fact we think of particles and waves as consisting of little wave packets
The wave packets consist of a range of frequencies, all travelling at slightly different speeds. The waves of different frequencies that make up the wavepacket interfere to some extent in the region of the wavepacket, but interfere completely destructively outside it. The net effect is that particles or light photons occupy a small region of space described by the wavepacket, and move at the speed of the wavepacket.