I am new to JavaScript and I am making and idle game and what I want to do is to change the value of a variable inside a function wich is called by an event listener like this:
const foo = (x) =>{
x = x + 1;
}
foofoo.addEventListener("click", function(){foo(x)})
where x is a variable is this possible?