To detect which one of the defined font was used in a web page with JavaScript, we use the font property.
For instance, we write
const font = document.getElementById("header").style.font;
to select the element with getElementById.
And then we get the font used with the style.font property.