What is JavaScript AST, how to play with it?

1.You can take a look at AST explorer. An online tool to explore the ASTs generated by more than 10 parsers. It is a good tool to learn AST tree of a language.
AST explorer source at Github.com.

enter image description here


2.Also you can paste your js code into JavaScript AST visualizer and click “show ast” button, you will see the AST visully.

demo js code:

function foo(d) {
  d += 3;
    return d+999
}
function bar(d) {
    return d*100
}

js ast demo

Leave a Comment