diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:41:15 -0500 |
commit | 4b1a9203c547c019fc5398082ae19a3f3d4c3efe (patch) | |
tree | d4a40e13ceeb9f85479605110a76e7a4d5f3b56b /files/de/web/javascript/reference/global_objects/array/@@unscopables | |
parent | 33058f2b292b3a581333bdfb21b8f671898c5060 (diff) | |
download | translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.gz translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.tar.bz2 translated-content-4b1a9203c547c019fc5398082ae19a3f3d4c3efe.zip |
initial commit
Diffstat (limited to 'files/de/web/javascript/reference/global_objects/array/@@unscopables')
-rw-r--r-- | files/de/web/javascript/reference/global_objects/array/@@unscopables/index.html | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/files/de/web/javascript/reference/global_objects/array/@@unscopables/index.html b/files/de/web/javascript/reference/global_objects/array/@@unscopables/index.html new file mode 100644 index 0000000000..2cb4b51b11 --- /dev/null +++ b/files/de/web/javascript/reference/global_objects/array/@@unscopables/index.html @@ -0,0 +1,76 @@ +--- +title: 'Array.prototype[@@unscopables]' +slug: Web/JavaScript/Reference/Global_Objects/Array/@@unscopables +tags: + - Array + - ECMAScript 2015 + - JavaScript + - Property + - Prototype +translation_of: Web/JavaScript/Reference/Global_Objects/Array/@@unscopables +--- +<div>{{JSRef}}</div> + +<p>Die <code><strong>@@unscopable</strong></code> Symbol Eigenschaft enthält Namen von Eigenschaften, welche vor der ES2015 Version nicht im ECMAScript Standard waren. Diese Eigenschaften werden bei <code><a href="/en-US/docs/Web/JavaScript/Reference/Statements/with">with</a></code> Statement Bindungen ignoriert.</p> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox"><var>arr</var>[Symbol.unscopables]</pre> + +<h2 id="Beschreibung">Beschreibung</h2> + +<p>Der Standard Array Eigenschaften, die von den <code>with</code> Bindungen ausgenommen werden, sind: <code>copyWithin</code>, <code>entries</code>, <code>fill</code>, <code>find</code>, <code>findIndex</code>, <code>includes</code>, <code>keys</code>, und <code>values</code>.</p> + +<p>Siehe {{jsxref("Symbol.unscopables")}} für das setzten von <code>unscopables</code> für eigene Objekte</p> + +<p>{{js_property_attributes(0,0,1)}}</p> + +<h2 id="Beispiele">Beispiele</h2> + +<p>Der Folgende Quelltext funktioniert in ES5 und niedriger. Jedoch wurde in ECMAScript 2015 und Später die {{jsxref("Array.prototype.keys()")}} eingeführt. Das bedeutet, dass in <code>with</code> Umgebungen "keys" jetzt eine Methode und keine Variable ist. Hier kommt die eingebaute <code>@@unscopables</code> <code>Array.prototype[@@unscopables]</code> Symboleigenschaft ins Spiel und verhindert, dass einige der Array Methoden in einer <code>with</code> Anweisung gescoped werden.</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="Spezifikationen">Spezifikationen</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Spezifikation</th> + <th scope="col">Status</th> + <th scope="col">Komment</th> + </tr> + <tr> + <td>{{SpecName('ES2015', '#sec-array.prototype-@@unscopables', 'Array.prototype[@@unscopables]')}}</td> + <td>{{Spec2('ES2015')}}</td> + <td>Initiale Definition.</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="Browserkompatibilität">Browserkompatibilität</h2> + +<div> + + +<p>{{Compat("javascript.builtins.Array.@@unscopables")}}</p> +</div> + +<h2 id="Siehe_auch">Siehe auch</h2> + +<ul> + <li>{{jsxref("Symbol.unscopables")}}</li> +</ul> |