I am currently learning ES6 and trying to implement a new function that displays the date on a website when hovering over it with the mouse. However, I have encountered an issue where the function is not working as expected. I would greatly appreciate any help in understanding why it's not functioning properly. Additionally, I received the error message "Uncaught ReferenceError: Cannot access 'Time' before initialization." Unfortunately, I am unsure how to resolve this error.
//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 = ``;
}