Skip to content

Instantly share code, notes, and snippets.

@fokusferit
Last active Jan 13, 2017
Embed
What would you like to do?
A basic AST for a one line ES6 code
{
"type": "Program",
"start": 0,
"end": 23,
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 22,
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 21,
"id": {
"type": "Identifier",
"start": 4,
"end": 9,
"name": "array"
},
"init": {
"type": "ArrayExpression",
"start": 12,
"end": 21,
"elements": [
{
"type": "Literal",
"start": 13,
"end": 14,
"value": 1,
"raw": "1"
},
{
"type": "Literal",
"start": 15,
"end": 16,
"value": 2,
"raw": "2"
},
{
"type": "Literal",
"start": 17,
"end": 20,
"value": "b",
"raw": "'b'"
}
]
}
}
],
"kind": "let"
}
],
"sourceType": "script"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment