Tutorials Examples

Drakon.Tech JavaScript tutorial: keywords var, const, and let

Do not use var, const, and let

Drakon.Tech will detect assignments and create variable declarations automatically.

Drakon.Tech protects you from writing to the global scope.

Exceptions

  1. Lambda expressions and function expressions.
  2. Roof, header, footer, and basement (in the properties of a module).

In the example below, the "array" variable is declared automatically, but "square" needs a "var" keyword (because it is inside a function expression):

array is declared automatically, but square needs a var keyword