this is a function that suppose to show the Date in the website when i move the mouse around it, i am learning right now es6 and got excited to use the new way of using functions but for some reason it dosnt work and i would be glad if some one helped me to understand why it doesnt work /=.
oh and if it will help i also copied the error "Uncaught ReferenceError: Cannot access 'Time' before initialization"
no idea how to deal with it.
//Time script
const question = document.querySelector(`.timeleftstyle`)
question.addEventListener(`mouseover`,Time);
question.addEventListener(`mouseout`,hide);
const Time = () => {
const clock = document.querySelector(`.thetime`);
clock.innerHTML=Date();
}
const hide = () => {
const clock = document.querySelector(`.thetime`);
clock.innerHTML=``;
}