how to set a interval in javascript for a particular action code example Example: js settimeout setTimeout(() => { alert('Hello') }, 1000)