Algorithm.

  1. create a function that executes for every second using setInterval.
  2. Get the total number of minutes .
  3. convert that into seconds and store in a global variable.
  4. decrement the seconds by “1" for each second.
  5. check if the seconds reach 0 if true then alert user and clear the timer.

Coding time , Get → set → go , start coding 🤩

<script>
var seconds = 0;
var interval ;
function pomodoro(mins) {
   seconds = mins*60 || 0;     
  interval = setInterval(function() {

seconds--;
 if(!seconds){
 clearInterval(interval); 
 alert("🚨 It is Cool 😎. I wish you could share ");
 }
 },1000)
}
</script> 

That’s it so simple on creating an awesomatic 😎 super exclusive pomodoro clock. Do Follow Javascript Jeep🚙 .