JavaScript const
JavaScript const
As we know, variables are containers for storing information. The const statement is used for declaring a variable. Creating a variable is similar to declaring a variable. One important thing is that the const variable must be assigned when it is declared. We mostly use const to declare new Array, new Object, new RegExp, and new Function.
Syntax:-
Its syntax is:- const name = value;
Further Explanation:-
Parameter | Description |
name |
Required. The name of the variable and must follow rules. These rules are:-
|
value | Required. A value to be assigned to the variable. |