Date.prototype.toSource()
非标准
该特性是非标准的,请尽量不要在生产环境中使用它!
toSource()
返回表示源代码的字符串。
语法
dateObj.toSource() Date.toSource()
返回值
表示Date
源代码的字符串
描述
toSource()
返回以下参数:
- 对于内置的
Date
对象,toSource()
返回以下字符串,表示源代码不可用:function Date() { [native code] }
- 对于
Date
的实例,toSource()
返回表示该日期源代码的字符串.
此方法通常由JavaScript内部调用,而不是在代码中显式调用。
规范
暂无标准, 在 JavaScript 1.3中实现.
浏览器兼容性
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.