Change this H1

This is a simple function that I created for this challenge. It changes the font of the H1 element by assigning it a class name that corresponds with a few CSS classes I set to have diifferent fonts.

Named Function

            function changeFont(fontName){
                document.querySelector('h1').className = fontName;
            }
            changeFont("courier");
        

Function Expression

            const changeFont = function(fontName){
                document.querySelector('h1').className = fontName;
            }
            changeFont("verdana");
        

Arrow Function

            const changeFont = fontName => document.querySelector('h1').className = fontName;
            changeFont("times");