Delay a function

The setTimeout function executes a given function after the specified delay (in milliseconds).

Setting timeouts is a synchronous action, which means that the program continues to perform instructions after setting the timeout. After a certain period of time, any ongoing execution will be interrupted to perform the sayGoodbye function.

Loading TypeScript...

Was this page helpful?