Here is my code:
window.addEventListener('keydown', randomD(e) {
if (e.keyCode === 32);
});
function randomD(e) {
const wordList = ['Carvedilol', 'Histrelin', 'Kadcyla', 'Mavyret', 'Paracetamol',
'Raloxifene', 'Saxagliptin'];
const display = document.querySelector("#wordDisplay");
const random = Math.floor(Math.random() * wordList.length);
const ranWord = wordList[random];
display.innerHTML = ranWord;
}
I want the key to be spacebar. It says after the if argument that "e" is declared but its value is never read. I'm a beginner and am not sure how to fix this or what the error indicates exactly. Any help would be appreciated.