function first () { console.log('first') setTimeout(second, 1000) } function second () { console.log('second') setTimeout(first, 1000) }