Actually, the prism disperses some infrared and ultraviolet light, but the human eye doesn't notice that.
In many scientific applications, greater and better dispersion is obtained using a diffraction grating rather than a prism.
A compact disc is incidentally acts as a crude diffraction grating. That is NOT its function, but it disperses light rather prettily.
Credit/Permission:
Lucas V. Barbosa (AKA User:LucasVB),
2007 /
Public domain.
Image link:
Wikipedia:
File:Light dispersion conceptual waves.gif.
Local file: local link: prism_animation.html.
File: Optics file:
prism_animation.html.