Closed lewisje closed 8 years ago
Javascript Garden only covers ES5. I think it would be great to extend this to ES6, but this would take a lot of work.
Those aren't even ES5 vs. ES6 things, but I will admit that browsers from when ES5 was ratified probably don't have either thing.
Specifically, requestAnimationFrame
was originally in the W3C Animation Timing Specification, but it was moved to HTML 5.1 when that spec was deprecated; setImmediate
was proposed to the W3C by Microsoft in 2011 but so far only adopted by Microsoft and Node and polyfilled fairly well for other modern browsers.
I'll close it anyway, because even mentioning these two things may complicate matters.
Their purpose is similar to
setTimeout
(with timeouts of 16 and 0, respectively), but as far as I can see, they lack the major issue ofsetTimeout
, because they do not accept strings of code.requestAnimationFrame
is implemented in modern browsers, and althoughsetImmediate
is only implemented in IE10+, Edge, and Node, and faces resistance from Gecko, WebKit, and Blink, it's still useful enough for a polyfill to be developed for it.