diff options
| author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:09 +0200 |
|---|---|---|
| committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
| commit | 844f5103992238c0c23203286dad16a466e89c97 (patch) | |
| tree | d537708951bb2b61be8192ffacc05a0ce6804f89 /files/fr/web/javascript/reference/global_objects/null/index.html | |
| parent | a70fd5b73ecb10bec3906640023e2a1a46e118a2 (diff) | |
| download | translated-content-844f5103992238c0c23203286dad16a466e89c97.tar.gz translated-content-844f5103992238c0c23203286dad16a466e89c97.tar.bz2 translated-content-844f5103992238c0c23203286dad16a466e89c97.zip | |
move *.html to *.md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/null/index.html')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/null/index.html | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/null/index.html b/files/fr/web/javascript/reference/global_objects/null/index.html deleted file mode 100644 index fb9a228f19..0000000000 --- a/files/fr/web/javascript/reference/global_objects/null/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: 'null' -slug: Web/JavaScript/Reference/Global_Objects/null -tags: - - JavaScript - - Littéral - - Primitive - - Reference -translation_of: Web/JavaScript/Reference/Global_Objects/null -original_slug: Web/JavaScript/Reference/Objets_globaux/null ---- -<div>{{jsSidebar("Objects")}}</div> - -<p>La valeur <strong><code>null</code></strong> est un littéral JavaScript représentant la nullité au sens où aucune valeur pour l'objet n'est présente. C'est une des valeurs primitives de JavaScript.</p> - -<div>{{EmbedInteractiveExample("pages/js/globalprops-null.html")}}</div> - -<h2 id="Syntaxe">Syntaxe</h2> - -<pre class="syntaxbox">null</pre> - -<h2 id="Description">Description</h2> - -<p>La valeur <code>null</code> est un littéral (et non pas une propriété de l'objet global telle que {{jsxref("undefined")}}). Dans certaines API, <code>null</code> est souvent utilisé en valeur de retour lorsqu'un objet est attendu mais qu'aucun objet ne convient. Lors de tests d'égalité avec <code>null</code> ou <code>undefined</code>, il faut faire attention aux <a href="/fr/docs/Web/JavaScript/Les_différents_tests_d_égalité_comment_les_utiliser">différences entre les opérateurs d'égalité faible (==) et stricte (===)</a> (on aura une conversion de type avec le premier).</p> - -<pre class="brush: js">// toto n'existe pas, n'a pas été défini et n'a jamais été initialisé -toto; -"ReferenceError: toto is not defined" - -// toto existe mais n'a ni type ni valeur -var toto = null; -console.log(toto); // null</pre> - -<h3 id="Différence_entre_null_et_undefined">Différence entre <code>null</code> et <code>undefined</code></h3> - -<pre class="brush: js">typeof null; // "object" (pas null pour des raisons historiques) -typeof undefined; // "undefined" -null === undefined; // false -null == undefined; // true -null === null; // true -null == null; // true -!null; // true -isNaN(1 + null); // false -isNaN(1 + undefined); // true -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</th> - <th scope="col">Commentaires</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Définition initiale.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-4.3.11', 'null value')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-null-value', 'null value')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-null-value', 'null value')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.null")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("undefined")}}</li> - <li>{{jsxref("NaN")}}</li> -</ul> |
