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/array/@@unscopables/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/array/@@unscopables/index.html')
| -rw-r--r-- | files/fr/web/javascript/reference/global_objects/array/@@unscopables/index.html | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/array/@@unscopables/index.html b/files/fr/web/javascript/reference/global_objects/array/@@unscopables/index.html deleted file mode 100644 index c0f9883779..0000000000 --- a/files/fr/web/javascript/reference/global_objects/array/@@unscopables/index.html +++ /dev/null @@ -1,73 +0,0 @@ ---- -title: Array.prototype[@@unscopables] -slug: Web/JavaScript/Reference/Global_Objects/Array/@@unscopables -tags: - - Array - - ECMAScript 2015 - - JavaScript - - Propriété - - Prototype -translation_of: Web/JavaScript/Reference/Global_Objects/Array/@@unscopables -original_slug: Web/JavaScript/Reference/Objets_globaux/Array/@@unscopables ---- -<div>{{JSRef}}</div> - -<p>La propriété symbol <code><strong>@@unscopable</strong></code> contient les noms des propriétés qui ne faisait pas partie du standard ECMAScript avant ES2015 (ES6). Ces propriétés sont exclues lors de liaisons effectuée via l'instruction <code><a href="/fr/docs/Web/JavaScript/Reference/Instructions/with">with</a></code>.</p> - -<h2 id="Syntaxe">Syntaxe</h2> - -<pre class="syntaxbox"><var>arr</var>[Symbol.unscopables]</pre> - -<h2 id="Description">Description</h2> - -<p>Les propriétés natives d'un objet <code>Array</code> qui sont exclues lorsqu'on utilise <code>with</code> sont <code>copyWithin</code>, <code>entries</code>, <code>fill</code>, <code>find</code>, <code>findIndex</code>, <code>includes</code>, <code>keys</code> et <code>values</code>.</p> - -<p>Voir la page sur le symbole {{jsxref("Symbol.unscopables")}} pour manipuler <code>unscopables</code> sur des objets personnalisés.</p> - -<p>{{js_property_attributes(0,0,1)}}</p> - -<h2 id="Exemples">Exemples</h2> - -<p>Le code qui suit fonctionne bien pour ES5 et les versions antérieures. En revanche, pour ECMAScript 2015 (ES6) et les versions ultérieures où la méthode {{jsxref("Array.prototype.keys()")}} existe, lorsqu'on utilise un environnement créé avec <code>with</code>, <code>"keys"</code> serait désormais la méthode et non la variable. C'est là que le symbole natif <code>@@unscopables</code> <code>Array.prototype[@@unscopables]</code> intervient et empêche d'explorer ces méthodes avec <code>with</code>.</p> - -<pre class="brush: js">var keys = []; - -with(Array.prototype) { - keys.push("something"); -} - -Object.keys(Array.prototype[Symbol.unscopables]); -// ["copyWithin", "entries", "fill", "find", "findIndex", -// "includes", "keys", "values"]</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('ES2015', '#sec-array.prototype-@@unscopables', 'Array.prototype[@@unscopables]')}}</td> - <td>{{Spec2('ES2015')}}</td> - <td>Définition initiale.</td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-array.prototype-@@unscopables', 'Array.prototype[@@unscopables]')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p>{{Compat("javascript.builtins.Array.@@unscopables")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("Symbol.unscopables")}}</li> -</ul> |
