aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/reference/errors/no_properties/index.html
blob: b355d15ea3d9c7514766a9f6f3c48982ebb43a84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
title: 'TypeError: "x" has no properties'
slug: Web/JavaScript/Reference/Errors/No_properties
translation_of: Web/JavaScript/Reference/Errors/No_properties
---
<div>{{jsSidebar("Errors")}}</div>

<h2 id="訊息">訊息</h2>

<pre class="syntaxbox">TypeError: null has no properties
TypeError: undefined has no properties
</pre>

<h2 id="錯誤類型">錯誤類型</h2>

<p>{{jsxref("TypeError")}}.</p>

<h2 id="哪裡錯了?">哪裡錯了?</h2>

<p>{{jsxref("null")}}{{jsxref("undefined")}} 並沒有可訪問的屬性。</p>

<h2 id="示例">示例</h2>

<pre class="brush: js example-bad">null.foo;
// TypeError: null has no properties

undefined.bar;
// TypeError: undefined has no properties
</pre>

<h2 id="參見">參見</h2>

<ul>
 <li>{{jsxref("null")}}</li>
 <li>{{jsxref("undefined")}}</li>
</ul>