Turn your ES5 code into readable ES6
21–30 of 31 posts
Re: Turn your ES5 code into readable ES6
#22I am asking as a poor JS developer - what are the benefits of this newer style?
Readable, and intuitive. The syntax is like a standard class (constructor, methods, getters, setters) you'd see in C or PHP.
Re: Turn your ES5 code into readable ES6
#23Earlier quoted context omitted.
Readable, and intuitive. The syntax is like a standard class (constructor, methods, getters, setters) you'd see in C or PHP.
What is the benefit of using classes rather than just bunch of functions, calling each other?
Re: Turn your ES5 code into readable ES6
#24Re: Turn your ES5 code into readable ES6
#25Earlier quoted context omitted.
Readable, and intuitive. The syntax is like a standard class (constructor, methods, getters, setters) you'd see in C or PHP.
What is the benefit of using classes rather than just bunch of functions, calling each other?
The main thing with having classes is about encapsulating functionality into objects which can be tested, reused and extended as a component in its own right.
Re: Turn your ES5 code into readable ES6
#26Earlier quoted context omitted.
Readable, and intuitive. The syntax is like a standard class (constructor, methods, getters, setters) you'd see in C or PHP.
What is the benefit of using classes rather than just bunch of functions, calling each other?
Re: Turn your ES5 code into readable ES6
#27Re: Turn your ES5 code into readable ES6
#28Neat. How about translating "require" calls to "import" statements (and exports statements)?
(that said, not all uses of require can be translated to import statements)
Re: Turn your ES5 code into readable ES6
#29I have started a similar project, but stopped working on it, and seeing this I decided to put it on GitHub, even though it's not very well tested and not feature complete. The most complex feature in my code is the ability to turn var into let/const optimally using an esgraph-based dataflow analysis, and it also has the ability to introduce arrow functions, shorthand/method properties and classes. It is implemented a…
Re: Turn your ES5 code into readable ES6
#30Sadly I get an error "Cannot find module './block-statement.js"