May 3rd, 2020 | 3 mins read
setTimeOut), network feature (as seen in
XTMLHTTPRequest) and so many more.
Interested to know more? Read further.
Have you ever tried executing something similar to the above on a NodeJS server?
An error is expected. Not because NodeJS scrapped out the
document object. This is because the
document object does not exist on NodeJS.
document object is exposed from the DOM API, the
fetch promise function is exposed from the Fetch API, the
navigator function is exposed from the Native Share API and so much more.
setInterval and many other time related methods.
Well, the latter is mostly correct. The W3C standards develops technical speicifications and guidelines which browsers follow during development and improvement. These standards apply also to HMTL, CSS and so on.
As a browser company, you can integrate other features but you must follow the standards for the majorly used features. This establishes an agreement between the browsers, and that's the reason why these APIs are mostly available among these browsers.
setTimeout still exists on NodeJS.
Thanks for reading : )