What is the difference if I pass the parameter to the function of the event or not, because if I do not put it, it will do the same job if I put the parameter Examples
let btn = document.getElementById("btn");
let p = document.getElementById("p");
function draw(x, y) {
let div = document.createElement("div");
div.innerText = 'x';
div.style.position = 'absolute';
div.style.top = y + 'px';
div.style.left = x + 'px';
document.body.append(div);
}
document.body.onclick = funcation(event){
draw(event.clientX, event.clientY)
}
document.body.onclick = function () {
console.log(event.clientX, event.clientY)
}