Change All Paragraphs to Green

This function will change all paragraphs on a page to green. I think this was an example function early on in DES157A

Named Function

            const para = document.querySelectorAll("p"); 

            para.forEach(function(eachPara){
                eachPara.style.color = "green";
            })
        

Function Expression

            const greenPara = para.forEach(function(eachPara){
                eachPara.style.color = "green"
            })
        

Arrow Function

            const greenPara = para.forEach(eachPara =>{
                eachPara.style.color = "green"
            });