Having trouble generating a random number from a function. Can someone help explain?
const MyButton = document.querySelector(".Flipper");
MyButton.addEventListener("click", recordLog);
function recordLog (){
MyButton.style.backgroundColor = 'red';
let RandomNumber = Math.floor(Math.random() * 256);
return RandomNumber;
console.log(RandomNumber);
};
I expect to retrieve the random number and log it to the console