5 ms·
I thought IE11 and earlier have none of these features right? And you can't run Edge on windows 7 right? And aren't more than 50% of windows sill Windows 7? And
by jay_kyburz 11y ago
I thought IE11 and earlier have none of these features right? And you can't run Edge on windows 7 right? And aren't more than 50% of windows sill Windows 7? And in't windows still 90% of the market?
I was thinking these features are still 5+ years away unless you are prepared to actually ask your users to switch to Chrome.
- callahad 11y agoTransformation of most ES6 features into functionally identical, backwards-compatible ES5 is trivial, and automated tools exist to do that, so you absolutely can use them today. For example, default arguments are purely syntactic sugar for `if (arg === undefined) { arg = x; }` in the first line of a function. Still, I'd much rather write ES6's declarative `function foo(arg=x) { }` syntax rather than imperatively implement it in ES5 each time I need it.
- jay_kyburz 11y agoAbsolutely agree, I was just confused by "all major desktop browsers will have support of the big ticket ES6 features" but I didn't think IE10 or 11 were getting any of these features.
- zeckalpha 11y ago> I need it. Need is a strong word.
- callahad 11y agoIn this case, "need" refers to the "if (x === undefined) { x = y }" pattern. Which is absolutely a need when implementing functions with variable arity. If I need that pattern, I'd rather write it declaratively than imperatively. :)
- zeckalpha 11y agoVariable arity is exactly the thing to which I refer. It isn't needed.
- jwalden 11y agoTechnically, default arguments don't <em>quite</em>, <em>purely</em>, desugar exactly into that -- there are some scoping complexities to them as well (possibly only for functions having strict mode code), the details of which I haven't fully internalized. Your observation is otherwise correct with a little bit of handwaving. :-)
- elmigranto 11y ago> windows still 90% of the market Of all the people on the web, or target audience of your website, or what market?
- jay_kyburz 11y agoI just checked my own stats. Chrome 62%, Safari 18.5, Firefox 10% Internet Explorer 3%