JenMorgan / js-learning

0 stars 0 forks source link

implement countDown function #64

Open kartamyshev opened 4 years ago

kartamyshev commented 4 years ago
countDown(5)
// logs 5, 4, 3, 2, 1
JenMorgan commented 4 years ago
function countDown (number) {
    if (number === 0) {
        return;
    }
    console.log(number);
    return countDown (number - 1);
}