-2

I developed a clock, and I need a loop that returns "s" at every second

There is only one function in my program

I am lost in creating this loop, can you guys help me?

Progman
  • 14,690
  • 4
  • 32
  • 46

1 Answers1

1

You can use setInterval :

setInterval(() => {
    // your code
}, 1000); // 1000ms = 1second

You can read the documentation here