Tell us what’s happening:
My solution appears to be fully functional but does not pass any tests where the timer must reach 00:00. As can be seen in my short video clip, the timer does display 00:00 before switching to ‘break’ (or back to ‘session’ at the end of ‘break’). From a user experience perspective, whatever is happening in the background appears to be irrelevant, but I’d like to understand what’s happening, and, if possible, edit the code to pass the tests, without having to completely overhaul it.
https://www.screencast.com/t/cPCKgO9uF7q
What I’ve tried
1.) After learning about how the setInterval method is not precise, I used the custom interval function from the fCC solution but it made no difference in the automated tests.
2.) After studying the code in the fCC solution, I noticed the timer in state hits -1 when the display is 00:00. My code does not allow for this because I check state at 0.
Your code so far
https://codepen.io/felavid/pen/GRWJqLp
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:88.0) Gecko/20100101 Firefox/88.0
.
Challenge: Build a 25 + 5 Clock
Link to the challenge: