I trying to create a variable and assign a value to it using img but bf the variable is assigned the alert at the end of the code is already executed [duplicate]

I trying to create a variable and assign a value to it using img but bf the variable is assigned the alert at the end of the code is already executed.

After the alert occurs, the function works normally, emitting an alert according to the selected image

github: https://github.com/LucasDSS888/Project-Rock-Paper-Scissors/tree/rps-ui

let humanChoiseNumb = humanChoiseImgClick();


function humanChoiseImgClick() {
    
    let num;

    const choiseAP = document.querySelector(".card.alexP");
    choiseAP.addEventListener("click", () => {
        num = 2;
        alert(num);
    });
    
    const choiseAR = document.querySelector(".card.alexR");
    choiseAR.addEventListener("click", () => {
        num = 1;
        alert(num);
    });

    const choiseAS = document.querySelector(".card.alexS");
    choiseAS.addEventListener("click", () => {
        num = 3;
        alert(num);
    });

    return num;

}

alert(humanChoiseNumb);

I expected the alert to be issued according to the value assigned to the humanChoiseNumb variable