blob: 265643c1da478b5411184bd87e8ab3b5a0a779bf (
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
---
title: Boolean.prototype.toSource()
slug: Web/JavaScript/Reference/Global_Objects/Boolean/toSource
translation_of: Web/JavaScript/Reference/Global_Objects/Boolean/toSource
original_slug: Web/JavaScript/Referencia/Objectes_globals/Boolean/toSource
---
<div>{{JSRef("Objectes_standard", "Boolean")}} {{non-standard_header}}</div>
<h2 id="Summary" name="Summary">Resum</h2>
<p>El mètode <code><strong>toSource()</strong></code> retorna una cadena de caràcters que representa el codi font de l'objecte.</p>
<h2 id="Syntax" name="Syntax">Sintaxi</h2>
<pre class="syntaxbox"><code><var>booleanObj</var>.toSource()
Boolean.toSource()</code></pre>
<h3 id="Parameters" name="Parameters">Paràmetres</h3>
<p>Cap.</p>
<h2 id="Description" name="Description">Descripció</h2>
<p>El mètode <code>toSource</code> retorna els valors següents:</p>
<ul>
<li>Per a objectes {{jsxref("Objectes_standard/Boolean", "Boolean")}} de la implementació de JavaScript, <code>toSource</code> retorna la següent cadena de caràcters indicant que el codi font no està disponible:
<pre class="brush: js">function Boolean() {
[native code]
}
</pre>
</li>
<li>Per a instàncies de {{jsxref("Objectes_standard/Boolean", "Boolean")}}, <code>toSource</code> retorna una cadena de caràcters que representa el codi font.</li>
</ul>
<p>Aquest mètode normalment és utilitzat internament per JavaScript i no explícitament al codi.</p>
<h2 id="Especificacions">Especificacions</h2>
<p>No forma part de cap standard. Implementat a JavaScript 1.3.</p>
<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2>
<div>{{CompatibilityTable}}</div>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Característica</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Suport bàsic</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Característica</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Suport bàsic</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="See_Also" name="See_Also">Vegeu també</h2>
<ul>
<li>{{jsxref("Object.prototype.toSource()")}} {{non-standard_inline}}</li>
</ul>
|