toSource()

优质
小牛编辑
124浏览
2023-12-01

toSource 方法

返回表示对象源代码的字符串。

语法:

  dateObject.toSource();

注:

该方法在 Internet Explorer 中无效。

示例:

  var DATE = new Date();  

  console.log( DATE.toSource() );

结果:

  >>>
  (new Date(1384323879074))
  string