aboutsummaryrefslogtreecommitdiff
path: root/files/de/web/javascript/reference/global_objects/array/tosource/index.html
blob: 0e7dd027457f70d21e5c058acf8c8e9934530f05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
title: Array.prototype.toSource()
slug: Web/JavaScript/Reference/Global_Objects/Array/toSource
tags:
  - Array
  - JavaScript
  - Method
  - Prototype
translation_of: Web/JavaScript/Reference/Global_Objects/Array/toSource
---
<div>{{JSRef}} {{non-standard_header}}</div>

<p>Die <code><strong>toSource()</strong></code> Methode gibt einen String zurück, welcher den Quelltext des Arrays repräsentiert.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox"><var>arr</var>.toSource()</pre>

<h3 id="Rückgabewert">Rückgabewert</h3>

<p>Ein String, der den Quelltext des Array repräsentiert.</p>

<h2 id="Beschreibung">Beschreibung</h2>

<p>Die <code>toSource</code> Methode gibt folgende Werte zurück:</p>

<ul>
 <li>Für das eingebaute {{jsxref("Array")}} Objekt gibt <code>toSource</code> den folgenden String zurück, um anzudeuten, dass der Quelltext nicht verfügbar ist:

  <pre class="brush: js">function Array() {
    [native code]
}
</pre>
 </li>
 <li>Für Instanzen von {{jsxref("Array")}} gibt <code>toSource</code> einen String zurück, welcher den Quelltext des Arrays repräsentiert.</li>
</ul>

<p>Diese Methode wird für gewöhnlich von JavaScript intern aufgerufen und nicht explizit in einem QUelltext. Man kann <code>toSource</code> beim Debuggen aufrufen, um den Inhalt eines Arrays abzufragen.</p>

<h2 id="Beispiele">Beispiele</h2>

<h3 id="Untersuchen_des_Quelltextes_eines_Arrays">Untersuchen des Quelltextes eines Arrays</h3>

<p><span class="short_text" id="result_box" lang="de"><span>Um den Quellcode eines Arrays zu untersuchen:</span></span></p>

<pre class="brush: js">var alpha = new Array('a', 'b', 'c');

alpha.toSource();
//returns ['a', 'b', 'c']
</pre>

<h2 id="Spezifikationen">Spezifikationen</h2>

<p>In keiner Spezifikation enthalten. Implementiert in JavaScript 1.3.</p>

<h2 id="Browserkompatibilität">Browserkompatibilität</h2>

<div>


<p>{{Compat("javascript.builtins.Array.toSource")}}</p>
</div>

<h2 id="Siehe_auch">Siehe auch</h2>

<ul>
 <li>{{jsxref("Object.prototype.toSource()")}}</li>
 <li>{{jsxref("Array.prototype.toString()")}}</li>
</ul>