set time loop javascript code example Example: js settimeout setTimeout(() => { alert('Hello') }, 1000)