Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1126551 of Type

  • Revision slug: Glossary/Type
  • Revision title: Type
  • Revision id: 1126551
  • Created:
  • Creator: chrisdavidmills
  • Is current revision? Yes
  • Comment

Revision Content

Type  (or data type) is a characteristic of a {{glossary("value")}} affecting what kind of data it can store — for example in JavaScript a {{domxref("Boolean")}} only holds true/false values, whereas a {{domxref("String")}} holdstext strings, a {{domxref("Number")}} holds numbers of any kind, etc.

A value's data type also affects which operations are valid on that value. For example, an integer can be multiplied by an integer, but not by a string.

Learn more

General knowledge

Revision Source

<p><strong>Type</strong>&nbsp; (or <em>data type</em>) is a characteristic of a {{glossary("value")}} affecting what kind of data it can store — for example in JavaScript a {{domxref("Boolean")}} only holds <code>true</code>/<code>false</code> values, whereas a {{domxref("String")}} holdstext strings, a {{domxref("Number")}} holds numbers of any kind, etc.</p>

<p>A value's data type also affects which operations are valid on that value. For example, an integer can be multiplied by&nbsp;an integer, but not by a string.</p>

<h2 id="Learn_more">Learn more</h2>

<h3 id="General_knowledge">General knowledge</h3>

<ul>
 <li>{{Interwiki("wikipedia", "Data type")}} on Wikipedia</li>
 <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures">Data types in JavaScript</a></li>
</ul>
Revert to this revision