e01.org

Constant

A constant is a value that the programmer cannot change, for example numbers (1, 2, 42). With variables, on the other hand, the programmer can assign a new value to a variable name already in use.

A **constant** is a value that the programmer cannot change, for example numbers (1, 2, 42). With variables, on the other hand, the programmer can assign a new value to a variable name already in use.

Like variables, some constants are bound to identifiers. For example, the identifier `pi` could be bound to the value 3.14….

## See also

- [Constant](<https://en.wikipedia.org/wiki/Constant_(computer_programming)>) on Wikipedia

source: MDN Web Docs mirror · page

Cite this

"Constant". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Glossary/Constant

JSON record · API collection · citation policy