aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/errors/no_properties/index.md
blob: 8309c98d5eae0aefe8f5f23fbb99384486fcbc11 (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
37
38
39
40
41
---
title: 'TypeError: "x" has no properties'
slug: Web/JavaScript/Reference/Errors/No_properties
tags:
  - Erreurs
  - JavaScript
  - Reference
  - TypeError
translation_of: Web/JavaScript/Reference/Errors/No_properties
original_slug: Web/JavaScript/Reference/Erreurs/No_properties
---
{{jsSidebar("Errors")}}

## Message

    TypeError: Unable to get property {x} of undefined or null reference (Edge)
    TypeError: null has no properties (Firefox)
    TypeError: undefined has no properties (Firefox)

## Type d'erreur

{{jsxref("TypeError")}}.

## Quel est le problème ?

Les valeurs {{jsxref("null")}} et {{jsxref("undefined")}} n'ont aucunes propriétés auxquelles accéder.

## Exemples

```js example-bad
null.toto;
// TypeError: null has no properties

undefined.truc;
// TypeError: undefined has no properties
```

## Voir aussi

- {{jsxref("null")}}
- {{jsxref("undefined")}}