New year

Report a typo

Complete the greetings() function below that displays a countdown from 5 to 1 on the console, with the delay of one second between each number, and then displays "Happy New Year!". You just have to complete the function and no need to call it.

Sample Input 1:

Sample Output 1:

5
4
3
2
1
Happy New Year!
Write a program in JavaScript
let days = 5;

function greetings() {
const intervalId = ...
...

if (count === 0) {
clearInterval(...);
console.log(...);
}
});
}
___

Create a free account to access the full topic