JavaScript Settimeout | Settimeout Function in JS Tutorial by WDH

JavaScript Settimeout


JavaScript Settimeout
setTimeout()
Call function or execute a code snippet after a specified delay.
The Syntax of Settimeout is as follows
const timeoutID = window.setTimeout(func, delay [param1, param2, …]);
const timeoutID = window.setTimeout(code, delay);
clearTimeout(timeoutID)// clearing setTimeout
Example1
Output
After five seconds 
Example2- Program to The setTimeout() and clear methods
Output