Skip to content

Instantly share code, notes, and snippets.

@fokusferit
Last active January 13, 2017 14:43
Show Gist options
  • Save fokusferit/e7e25234a06cb42e3aafd2db0ffd2bc1 to your computer and use it in GitHub Desktop.
Save fokusferit/e7e25234a06cb42e3aafd2db0ffd2bc1 to your computer and use it in GitHub Desktop.
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