Mascara JavaScript compiler

Try it Download Buy About Documentation Blog Contact

Constants

A constant is like a variable which cannot change its value after definition. (Se variable definition)
Syntax definition [Help]
const name [ : type ] = expression 
  [ , name [ : type ] = expression ]*
Example:
const a = 10;
const b : String = "Hello";
A const definition may occur any place where a var definition is allowed.

Any attempt to change the value of a const will result in an error.