Re:Xto6 modernizes your JavaScript code
by davedx on Tuesday December 15, 2015 @09:59AM
(#10738049)
You should really qualify that with "transpiled ES6 features". Native implementations will not necessarily be slower.
[ Parent
| on HN ]
Re:Xto6 modernizes your JavaScript code
by daliwali on Tuesday December 15, 2015 @11:42AM
(#10738743)
I think this is incorrect, some features are by definition slower. Take for example the iterable protocol, it will always be slower than a traditional for loop [1] because the spec mandates a prototype lookup and function call [2].
So far the only features that are actually fast are generators and the new data types (Map, Set, et al).
[1] https://jsperf.com/for-vs-for-of/2
[2] https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...