Creating a Pomodoro Timer in JavaScript in 10 Lines of Code

added by JavaScript Kicks
8/14/2019 7:28:24 AM

879 Views

Algorithm: Create a function that executes every second using setInterval. Get the total number of minutes. Convert that into seconds and store in a global variable. Decrement the seconds by "1" for each second. Check if the seconds reaches 0. If true then alert the user and clear the timer.


0 comments