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

Variable definition

Syntax

  • var and let are equivalent.
  • const and let const are equivalent.

Note: The let and let const kinds compared to var and const are a matter of personal taste. They are introduced in ShockScript since they were proposed in the non-existing ECMAScript 4.

    VariableDefinitionβ :
      VariableDefinitionKind VariableBindingListβ
    VariableDefinitionKind :
      var
      const
      let [lookahead ≠ const ]
      let const
    VariableBindingListβ :
      VariableBindingβ
      VariableBindingListβ , VariableBindingβ
    VariableBindingβ :
      TypedPattern VariableInitializationβ
    VariableInitializationβ :
      «empty»
      = AssignmentExpressionβ