From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../global_objects/array/@@unscopables/index.html | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 files/de/web/javascript/reference/global_objects/array/@@unscopables/index.html (limited to 'files/de/web/javascript/reference/global_objects/array/@@unscopables') 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 +--- +
{{JSRef}}
+ +

Die @@unscopable Symbol Eigenschaft enthält Namen von Eigenschaften, welche vor der ES2015 Version nicht im ECMAScript Standard waren. Diese Eigenschaften werden bei with Statement Bindungen ignoriert.

+ +

Syntax

+ +
arr[Symbol.unscopables]
+ +

Beschreibung

+ +

Der Standard Array Eigenschaften, die von den with Bindungen ausgenommen werden, sind: copyWithin, entries, fill, find, findIndex, includes, keys, und values.

+ +

Siehe {{jsxref("Symbol.unscopables")}} für das setzten von unscopables für eigene Objekte

+ +

{{js_property_attributes(0,0,1)}}

+ +

Beispiele

+ +

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 with Umgebungen "keys" jetzt eine Methode und keine Variable ist. Hier kommt die eingebaute @@unscopables Array.prototype[@@unscopables] Symboleigenschaft ins Spiel und verhindert, dass einige der Array Methoden in einer with Anweisung gescoped werden.

+ +
var keys = [];
+
+with (Array.prototype) {
+  keys.push('something');
+}
+
+Object.keys(Array.prototype[Symbol.unscopables]);
+// ["copyWithin", "entries", "fill", "find", "findIndex",
+//  "includes", "keys", "values"]
+ +

Spezifikationen

+ + + + + + + + + + + + + + + + + + + +
SpezifikationStatusKomment
{{SpecName('ES2015', '#sec-array.prototype-@@unscopables', 'Array.prototype[@@unscopables]')}}{{Spec2('ES2015')}}Initiale Definition.
{{SpecName('ESDraft', '#sec-array.prototype-@@unscopables', 'Array.prototype[@@unscopables]')}}{{Spec2('ESDraft')}} 
+ +

Browserkompatibilität

+ +
+ + +

{{Compat("javascript.builtins.Array.@@unscopables")}}

+
+ +

Siehe auch

+ + -- cgit v1.2.3-54-g00ecf