Yngvarr

Generation

generate functionFri, 10 Feb 2023

timeout counter

function timeoutCounter(seconds, callback) { setTimeout(function() { let time = seconds-- callback(time) return timeoutCounter(seconds, callback) }, 1000) } timeoutCounter(10, function(count) { console.log(count) })

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant