Is setTimeout a part of JavaScript it self or it is just an api that the browser provides ?
Is it a part of ES ?
setTimeout() - Web APIs.
The setTimeout() method executes a block of code after the specified time. The method executes the code only once. The commonly used syntax of JavaScript setTimeout is: setTimeout(function, milliseconds);
There are two most common built-in timer functions, setTimeout and setInterval , which can be used to call a function at a later time. For an example usage: setTimeout(function () { console.
The setTimeout() is executed only once. If you need repeated executions, use setInterval() instead. Use the clearTimeout() method to prevent the function from starting.
The setTimeout()
function is actually exposed by the browser's window
object as as such they aren't necessarily defined in the ECMAScript specification because they're not JavaScript features, they are features of the browser itself.
You can see from the specification section in the previously linked documentation that it uses the WHATWG HTML Living Standard :
As opposed to a Javascript function like split()
that explicitly uses EMACScript :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With