I want to create a alert \"Hello\" which will show up after 10sec. I used setTimeout and it working fine. Now i would like to do counter(timer) which will show 10, 9, 8,7 ...
You'll have to make one, setInterval would be a good choice for counter.
var time = 10, x = setInterval(function () { console.log(--time); if (time === 0) { alert("hello"); clearInterval(x); } }, 1000);