Const (computer programming): Difference between revisions

Content deleted Content added
const in Javascript does not mean constant. As the variable is still mutable for complex types.
Tags: Reverted Visual edit
Reverted good faith edits by Afitterling (talk): This is already mentioned in section 'Other languages' (does not need to be in the lead section)
Line 1:
{{short description|Type qualifier}}
{{lowercase title}}
In the [[C (programming language)|C]], [[C++]], [[D (programming language)|D]], [[JavaScript]] and [[Julia (programming language)|Julia]] [[programming language]]s, '''const''' is a [[type qualifier]]:{{efn|In D the term ''type constructor'' is used instead of ''type qualifier,'' by analogy with [[Constructor (object-oriented programming)|constructors in object-oriented programming]].}} a [[Keyword (computer programming)|keyword]] applied to a [[data type]] that indicates that the data is read only. (As for Javascript, Lists or Objects are still mutable but cannot be redefined). While this can be used to declare [[Constant (computer programming)|constants]], <code>const</code> in the C family of languages differs from similar constructs in other languages in being part of the ''type,'' and thus has complicated behavior when combined with [[Pointer (computer programming)|pointers]], references, [[composite data type]]s, and type-checking.
 
== Introduction ==