Const (computer programming): Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 122.52.196.197 to version by Taumata994. Report False Positive? Thanks, ClueBot NG. (3819188) (Bot)
const in Javascript does not mean constant. As the variable is still mutable for complex types.
Tags: Reverted Visual edit
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 ==