Declares a block-scoped variable with a constant value.
The name of the variable being declared.
The initial value assigned to the variable.
Use the const statement to declare a variable with a constant value, the scope of which is restricted to the block in which it is declared. The value of the variable cannot be changed.
A variable declared using const must be initialized when it is declared.
The following example illustrates the use of the const statement.
Supported in the Internet Explorer 11 standards document mode. Also supported in Store apps (Windows 8.1 and Windows Phone 8.1). See Version Information.
Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards. Not supported in Windows 8.