3 ms·
> 10-12 years ago So you've had JS before? The good new is that most of what you know still works. The bad news is that the landscape is now polluted with a lo
by lollipop25 11y ago
> 10-12 years ago
So you've had JS before? The good new is that most of what you know still works. The bad news is that the landscape is now polluted with a lot of tools, frameworks and whatnots. Best to avoid the hype if you want to take it seriously.
ES5 brought a lot to JS without change to the syntax. ES5 focuses more on added essential native APIs, especially array operations like map, reduce, filter etc. If you manage that, you'll be able to fend off utility libraries like underscore and lodash until needed. Kangax's compatibility table should give you an overview of what was introduced: http://kangax.github.io/compat-table/es5/ http://kangax.github.io/compat-table/es5/
Once you've got a handle of ES5, brace yourself for ES6. ES6 introduces a lot of foreign constructs as well as syntax changes. If you've been in Python, the destructuring, rest and spread, and module import syntax will look familiar. If you've been in Java and C#, there's now the concept of classes (albeit, it's still prototypal inheritance under the hood).
But for now, ES5 stuff should be enough to cover the basic needs. ES6 is more of conciseness, convenience and all that. The reason why transpilers exist is because what you can do in ES6 can essentially be done in ES5 but just taking the longer route to do it.
- deleted 11y ago[deleted]
- simonebrunozzi 11y agoThanks, very useful answer. Yes, I had JS, and I had Java and C++ (and Fortran77! I was good. And Assembly), and some Python and a little Ruby. Most of them are quite rusty at this point. Would you suggest to go straight to ES6 then? Also, what could be the best choice to then being able to write chrome extensions and perhaps chrome apps?
- lollipop25 11y ago> Would you suggest to go straight to ES6 then? ES6, while it's there, is not a must. It's not like the old syntax will stop working. Take in only what you need. For instance, native Promises are handy, arrow functions are concise, but I have yet to find compelling use cases to write generators, proxies, destructuring and all the other funky stuff. > what could be the best choice to then being able to write chrome extensions and perhaps chrome apps? If you're writing from v8-based platforms (Node, Chrome), then most of ES6 should be available. https://kangax.github.io/compat-table/es6/#chrome49 https://kangax.github.io/compat-table/es6/#chrome49