Tengo el siguiente código:
var timer = 15; $("body").on("keyup", function(event) { var tickerInterval = setInterval(clock_ticker, 1000); }); function clock_ticker() { timer--; // Does a bunch of things console.log(timer); if(timer == 0) { clearInterval(tickerInterval); } } Sin embargo, me da un error sobre tickerInterval no definido. ¿Qué estoy haciendo mal aquí?