Javascript 中的 constructor构造函数

首页 / JavaScript入门教程 / Javascript 中的 constructor构造函数

JavaScript date constructor 构造函数属性返回对创建原型的数组函数的引用。

constructor - 语法

date.constructor

constructor - 返回值

返回创建此对象的函数。

constructor - 示例

<html>
   <head>
      <title>JavaScript Date constructor Property</title>
   </head>
   
   <body>   
      <script type="text/javascript">
         var dt=new Date();
         document.write("dt.constructor is : " + dt.constructor); 
      </script>      
   </body>
</html>

运行上面代码输出

无涯教程网

链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/date-constructor.html

来源:LearnFk无涯教程网

dt.constructor is: function Date() { [native code] } 

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

趣谈网络协议 -〔刘超〕

iOS开发高手课 -〔戴铭〕

透视HTTP协议 -〔罗剑锋(Chrono)〕

Elasticsearch核心技术与实战 -〔阮一鸣〕

Redis核心技术与实战 -〔蒋德钧〕

Go 并发编程实战课 -〔晁岳攀(鸟窝)〕

说透5G -〔杨四昌〕

大数据经典论文解读 -〔徐文浩〕

结构写作力 -〔李忠秋〕

好记忆不如烂笔头。留下您的足迹吧 :)