diff options
author | MDN <actions@users.noreply.github.com> | 2021-06-15 00:35:40 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-06-15 00:35:40 +0000 |
commit | 522984283b56b68582d606c76e4ca98c0baf9451 (patch) | |
tree | 0bf1a6328efd2bf74b118ff823b5208de78dec0b /files/de/web/javascript | |
parent | ee3bbc7c983772815b6168c0c146fabbf1536105 (diff) | |
download | translated-content-522984283b56b68582d606c76e4ca98c0baf9451.tar.gz translated-content-522984283b56b68582d606c76e4ca98c0baf9451.tar.bz2 translated-content-522984283b56b68582d606c76e4ca98c0baf9451.zip |
[CRON] sync translated content
Diffstat (limited to 'files/de/web/javascript')
-rw-r--r-- | files/de/web/javascript/reference/errors/typed_array_invalid_arguments/index.html | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/files/de/web/javascript/reference/errors/typed_array_invalid_arguments/index.html b/files/de/web/javascript/reference/errors/typed_array_invalid_arguments/index.html deleted file mode 100644 index b6621776e6..0000000000 --- a/files/de/web/javascript/reference/errors/typed_array_invalid_arguments/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: 'TypeError: invalid arguments' -slug: Web/JavaScript/Reference/Errors/Typed_array_invalid_arguments -tags: - - Error - - Errors - - JavaScript - - TypeError -translation_of: Web/JavaScript/Reference/Errors/Typed_array_invalid_arguments -original_slug: Web/JavaScript/Reference/Fehler/Typed_array_invalid_arguments ---- -<div>{{jsSidebar("Errors")}}</div> - -<h2 id="Fehlermeldung">Fehlermeldung</h2> - -<pre class="syntaxbox">TypeError: invalid arguments (Firefox)</pre> - -<h2 id="Fehlertyp">Fehlertyp</h2> - -<p>{{jsxref("TypeError")}}</p> - -<h2 id="Was_ist_falsch_gelaufen">Was ist falsch gelaufen?</h2> - -<p>Der <a href="/de/docs/Web/JavaScript/Typed_arrays">Typed Array</a> Konstruktor erwartet entweder</p> - -<ul> - <li>eine Länge,</li> - <li>ein anderes Typed Array,</li> - <li>Array ähnliche Objete,</li> - <li>iterierbare Objekte oder</li> - <li>ein {{jsxref("ArrayBuffer")}} Objekt,</li> -</ul> - -<p>um ein neues Typed Array zu erstelltn. Andere Argumente im Konstruktor erstellen kein valides Typed Array.</p> - -<h2 id="Beispiele">Beispiele</h2> - -<p>Typed Arrays, zum Beispiel ein {{jsxref("Uint8Array")}}, können nicht von einem String erstellt werden. <span class="short_text" id="result_box" lang="de"><span>Tatsächlich können String nicht in typisierten Arrays enthalten sein.</span></span></p> - -<pre class="brush: js example-bad">var ta = new Uint8Array("nope"); -// TypeError: invalid arguments -</pre> - -<p>Verschiedene Wege um ein valides {{jsxref("Uint8Array")}} Objekt zu erstellen:</p> - -<pre class="brush: js example-good">// From a length -var uint8 = new Uint8Array(2); -uint8[0] = 42; -console.log(uint8[0]); // 42 -console.log(uint8.length); // 2 -console.log(uint8.BYTES_PER_ELEMENT); // 1 - -// From an array -var arr = new Uint8Array([21,31]); -console.log(arr[1]); // 31 - -// From another TypedArray -var x = new Uint8Array([21, 31]); -var y = new Uint8Array(x); -console.log(y[0]); // 21 - -// From an ArrayBuffer -var buffer = new ArrayBuffer(8); -var z = new Uint8Array(buffer, 1, 4); - -// From an iterable -var iterable = function*(){ yield* [1,2,3]; }(); -var uint8 = new Uint8Array(iterable); -// Uint8Array[1, 2, 3] -</pre> - -<h2 id="Siehe_auch">Siehe auch</h2> - -<ul> - <li><a href="/de/docs/Web/JavaScript/Typed_arrays">Typed arrays</a></li> - <li>{{jsxref("ArrayBuffer")}}</li> - <li>{{jsxref("Uint8Array")}}</li> -</ul> |