-1

For a deeper understanding of Javascript, I would like to know if the Timers (created with setTimeout and setInterval) are API's just like all the others included with HTML5, the DOM etc?

If so, what is Javascript purely?

@edit

this discussion started when I was thinking about Node, trying to compare what is Node (Javascript on server) with the good old Javascript on the browser

Victor Ferreira
  • 6,151
  • 13
  • 64
  • 120

1 Answers1

2

See MDN. It is usually a good pointer to where feature are specified.

It will tell you that setTimeout is defined by WHATWG HTML Living Standard (i.e. not by any version of the ECMAScript® Language Specification).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • so Hmm good. is it right to say they are not implemented natively in Javascript? – Victor Ferreira May 09 '17 at 13:27
  • 2
    @VictorFerreira that depends on the runtime context. They *might* be implemented in JavaScript, or in C++ or whatever else is appropriate for a particular runtime. The most important fact is that they're not part of the programming language environment as stipulated by the ECMA specification. – Pointy May 09 '17 at 13:29
  • http://stackoverflow.com/questions/13616102/how-is-settimeout-implemented-in-node-js just found something similar to my question – Victor Ferreira May 09 '17 at 13:29