blob: b4b814de9b662513089c1cfa7e015d03385cb096 (
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
|
---
title: String.prototype.toSource()
slug: Web/JavaScript/Reference/Global_Objects/String/toSource
translation_of: Web/JavaScript/Reference/Global_Objects/String/toSource
---
<div>{{JSRef}} {{non-standard_header}}</div>
<p>The <strong><code>toSource()</code></strong> method returns a string representing the source code of the object.</p>
<h2 id="문법">문법</h2>
<pre class="syntaxbox"><code>String.toSource()
<var>str</var>.toSource()
</code></pre>
<h3 id="리턴_값">리턴 값</h3>
<p>호출한 객체의 소스코드가 <code>string</code>으로 보여집니다.</p>
<h2 id="설명">설명</h2>
<p><code>toSource()</code> 메소드는 다음 값을 리턴:</p>
<p>For the built-in {{jsxref("String")}} object, <code>toSource()</code> returns the following string indicating that the source code is not available:</p>
<pre class="brush: js">function String() {
[native code]
}
</pre>
<p>For instances of {{jsxref("String")}} or string literals, <code>toSource()</code> returns a string representing the source code.</p>
<p>This method is usually called internally by JavaScript and not explicitly in code.</p>
<h2 id="Specifications">Specifications</h2>
<p>Not part of any standard. Implemented in JavaScript 1.3.</p>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("javascript.builtins.String.toSource")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>{{jsxref("Object.prototype.toSource()")}}</li>
</ul>
|