aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/glossary/type/index.html
blob: 8a2a1106fda0fd5d15646425b28f285c0a0f96df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
title: 型別
slug: Glossary/Type
translation_of: Glossary/Type
---
<p><strong>型別</strong>(或<em>資料型別</em>)是能決定 {{glossary("value")}} 該存為何種類型的特性:例如 JavaScript 的 {{domxref("Boolean")}} 只能存為 <code>true</code>/<code>false</code> 兩者其一、而字串({{domxref("String")}})能存為文字字串、{{domxref("Number")}} 則能存城任何類型的數字……等等。</p>

<p>型別也能決定哪些操作是有效的:例如說整數(integer)可以與整數相乘,但不能與字串相乘。</p>

<h2 id="深入了解">深入了解</h2>

<h3 id="基本知識">基本知識</h3>

<ul>
 <li>維基百科的{{Interwiki("wikipedia", "資料型別")}}</li>
 <li><a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Data_structures">JavaScript 的資料型別</a></li>
</ul>