Hint: Waves are described in physics as oscillations around a fixed point accompanied by energy transfer from one medium to another. The resultant wave can be defined as a mechanical wave when energy is transferred through a medium due to oscillation.
Complete answer: A transverse wave in physics has oscillations that are perpendicular to the wave's forward motion. On the other hand, a longitudinal wave travels in the same direction as its oscillations. The oscillations in light are electric and magnetic fields that are at right angles to the propagation path described by ideal light rays. The observable portion of the electromagnetic spectrum is light, which consists of a variety of wavelengths of electromagnetic waves, the majority of which are invisible to the naked eye. X-rays, gamma rays, infrared and ultraviolet rays are examples of these unseen electromagnetic waves. Light does not need a medium to transmit since it is an electromagnetic wave. This is why, in the vacuum of space, we receive light from the sun and can see distant stars and galaxies at night. Since they vibrate energy in a direction perpendicular to the wave's travel direction, all electromagnetic waves, including light, are transverse waves. Since there is no mechanism for driving motion perpendicular to the propagation of the wave in a gas or a liquid, transverse waves cannot propagate. Light, on the other hand, is an exception since it is both a transverse and an electromagnetic wave that can pass through any medium. Because of its similar existence, it is often known as a transverse wave.
Note: Frequency is a property of light that does not shift when it passes from one medium to another. As light passes from one medium to another, other properties of light such as wavelength and speed shift.