Constant Variables

This lesson discusses constant variables and how they differ from let variables.

What Are Constant Variables?

Constant variables are ones that are declared constant throughout the program scope, meaning, their value cannot be modified. They can be defined in global and local scope.

Syntax

They are declared using the const keyword followed by the name of the variable, colon (:), and then the data type of the variable.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy