A function that is to be executed when the timer expires.
Using a different syntax, we may supply a string rather than a function that will be constructed and executed after the timeout expires. The same security issues that come with using eval() apply to this syntax, thus it’s generally not recommended.
This is the time, in milliseconds for which the timer have to wait before the specified function or code is executed. If this parameter is deleted, a value of 0 will be used, which means execute “immediately”, or more precisely, the next event cycle.
We should note that in either case, the actual delay can be longer than intended; We can see the Reasons for delays that are longer than specified below.
We should also note that if the value is not a number, implicit type coercion is done silently on the value for converting it to a number — this can possibly lead to unexpected and surprising results; We can see Non-number delay values that are coerced silently into numbers taken as example.
param1, …, paramN (Optional)
These are the additional arguments that are passed through to the function which are specified by rifunctionRef.
The returned timeoutID is supposed to be a positive integer value that identifies the timer created by the call to setTimeout().
It is generally guaranteed that a timeoutID value is never going to be reused by any consequent call to setTimeout() or setInterval() on the same object.