diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/javascript/reference/global_objects/date/tosource | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/date/tosource')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/date/tosource/index.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/date/tosource/index.html b/files/zh-cn/web/javascript/reference/global_objects/date/tosource/index.html new file mode 100644 index 0000000000..dbcae1c739 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/date/tosource/index.html @@ -0,0 +1,50 @@ +--- +title: Date.prototype.toSource() +slug: Web/JavaScript/Reference/Global_Objects/Date/toSource +translation_of: Web/JavaScript/Reference/Global_Objects/Date/toSource +--- +<div>{{JSRef}} {{non-standard_header}}</div> + +<p><strong><code>toSource() </code></strong>返回表示源代码的字符串。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox"><var>dateObj</var>.toSource() +Date.toSource()</pre> + +<h3 id="返回值">返回值</h3> + +<p> 表示{{jsxref("Global_Objects/Date", "Date")}} 源代码的字符串</p> + +<h2 id="描述">描述</h2> + +<p><code>toSource()</code> 返回以下参数:</p> + +<ul> + <li>对于内置的{{jsxref("Date")}} 对象, <code>toSource()</code> 返回以下字符串,表示源代码不可用: + + <pre class="brush: js">function Date() { + [native code] +} +</pre> + </li> + <li>对于{{jsxref("Date")}}的实例, <code>toSource()</code> 返回表示该日期源代码的字符串.</li> +</ul> + +<p>此方法通常由JavaScript内部调用,而不是在代码中显式调用。</p> + +<h2 id="规范">规范</h2> + +<p>暂无标准, 在 JavaScript 1.3中实现.</p> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("javascript.builtins.Date.toSource")}}</p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{jsxref("Object.prototype.toSource()")}}</li> +</ul> |