Output every second
Write a function
printNumbers(from, to) that outputs a number every second, starting from
from and ending with
Make two variants of the solution.
- Using recursive
Note that in both solutions, there is an initial delay before the first output. Sometimes we need to add a line to make the first output immediately, that’s easy to do.