Babel in ES6
The process involves three primary steps:
1. Parsing: Babel takes the source code and parses it as an AST ( Abstract Syntax Tree). An AST is a data structure that represents the structure of a source code as a tree.
2. Transforming: Babel transforms the AST from the last step and manipulates it such that the resultant AST represents browser-compatible code.
3. Code Generation: A browser-supported code is derived from the AST generated from the last step in Babel.