I am not quite sure about the syntax of the forEach method, I would like to rewrite the below code to a forEach method, what is the best way to rewrite it?
const liTag=Array.from(document.querySelectorAll('li'));
for(const li of liTag){
li.addEventListener('click',function(){
console.log("it's clicked")
})
}