Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Viết hàm countDown đếm ngược từ x về 0, mỗi lần đếm cách nhau 1s, sau đó hiển thị 'Happy new year'
- */
- function countDown(x) {
- var countDowntID = setInterval(function(){
- --x;
- console.log(x);
- if(x === 0){
- clearInterval(countDowntID);
- console.log('Happy new year');
- }
- },1000);
- }
- countDown(5);
Add Comment
Please, Sign In to add comment