Hey Everyone.
I’m stuck on #8 in the Mole UnEarther project.
#8 instructions: Now that we have a function to update the timer, we can use it after each second elapses.
Locate the onSecondElapsed()
function inside create()
. This function is already set up to execute after every second passes. We can take advantage of this to also update the timer by making our call to the updateTimer()
function inside the onSecondElapsed()
function.
When we run the program again, we can see our timer count down!
My code:
create() {
let updateTimer = () => {
variable -= 1;
}
// executed after every second passes
const onSecondElapsed = () => {
if (isPaused === false) {
console.log(updateTimer);
So, I added the updateTimer function , the variable -= 1, and the console.log(updateTimer); BUT …
The timer does not count down when I click save. Someone help please!
-Suzana