— I mean when you do this

addEventListener(‘click’, x=function(){})

This will evaluate your expression assignment x=function(){} and will return the function

So the line above is almost the same as

x=function(){}

addEventListener(‘click’, x)

That’s why it will always your conditional if (x) be true

Message permanent page