JD

AST Explorer

Explore the Abstract Syntax Tree of JavaScript code

Source Code
function greet(name) {
  const message = "Hello, " + name;
  return message;
}
AST Tree
Program[0:67]
FunctionDeclarationgreet(name)[0:67]
BlockStatement[19:67]

The Abstract Syntax Tree is a tree representation of the source code structure. Each node represents a syntactic construct — declarations, expressions, statements. Parsers like acorn, esprima, or @babel/parser produce this tree from source code.