How can get the value from the eventListener and assign it to the humanChoice variable?

//selecting the buttons from the html that hold the options which the human player will choose from

const buttons = document.querySelectorAll(‘button’);

let humanChoice = ‘’; // assigning a empty value to humanChoice variable

//iterating through the buttons to capture the specific choice of the human player

buttons.forEach((button) =>{

    button.addEventListener('click', (e)=>{

        humanChoice =  e.currentTarget.value; //assigning the value button that the user clicked yo the humanChoice variable

    });

});

//function making the computer choose randomly

function computerPlay() {

const list = ["Rock","Paper","Scissors"];

return list[Math.floor(Math.random()*list.length)];

}

//using the return value of the computerPlay() by storing it in a variable, compChoice

const compChoice = computerPlay();

//A function with the conditions that determine the winner

function play(){

 if (humanChoice === compChoice){

     alert('it\'s a tie');

 }else if(compChoice === 'Rock'&& humanChoice === 'Scissors'||compChoice==='Scissors'&& humanChoice==='Paper'||compChoice==='Paper'&& humanChoice === 'Rock'){

        alert('computer wins');

 }

 else if (humanChoice !=='Rock'||humanChoice !=='Paper'||humanChoice !=='Scissors'){

     alert('Please enter either "Rock", "Paper", or "Scissors"');

 }

 else{

     alert('You win');

 }

}

play();

console.log(compChoice);