Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Kernel Form Vocabulary

Every kernel form, its ESTree node, and its JavaScript output. This is the table the reader has been implicitly relying on since Chapter 2.

Declarations

KernelESTreeJS
constVariableDeclaration (const)const x = ...;
letVariableDeclaration (let)let x = ...;
functionFunctionDeclarationfunction f() {}
lambdaFunctionExpressionfunction() {}
=>ArrowFunctionExpression() => {}
classClassDeclarationclass X {}

Modules

KernelESTreeJS
importImportDeclarationimport ... from "..."
exportExportNamedDeclarationexport ...
dynamic-importImportExpressionimport("...")

Control Flow

KernelESTreeJS
ifIfStatementif (...) {} else {}
?ConditionalExpression... ? ... : ...
forForStatementfor (...) {}
for-ofForOfStatementfor (... of ...) {}
for-inForInStatementfor (... in ...) {}
whileWhileStatementwhile (...) {}
do-whileDoWhileStatementdo {} while (...)
switchSwitchStatementswitch (...) {}
returnReturnStatementreturn ...
throwThrowStatementthrow ...
tryTryStatementtry {} catch {}
breakBreakStatementbreak
continueContinueStatementcontinue

Expressions

KernelESTreeJS
+, -, *, /, %, **BinaryExpressiona + b
<, >, <=, >=BinaryExpressiona < b
===, !==BinaryExpressiona === b
&&, ||LogicalExpressiona && b
??LogicalExpressiona ?? b
!UnaryExpression!x
typeofUnaryExpressiontypeof x
newNewExpressionnew X()
getMemberExpression (computed)obj[key]
templateTemplateLiteral`...`
objectObjectExpression{ ... }
arrayArrayExpression[ ... ]
regexRegExpLiteral/pattern/flags
spreadSpreadElement...x