Is setTimeout a part of JavaScript it self or it is just an api that the browser provides ?
Is it a part of ES ?
Is setTimeout a part of JavaScript it self or it is just an api that the browser provides ?
Is it a part of ES ?
From MDN:
Specification WHATWG HTML Living Standard
… and you won't see it in ECMA-262 5.1.
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 :
It is part of the window
object in the browser, not defined in ECMAScript. Therefore, other environments such as Node are not guaranteed to have it.