Javascript 中的 constructor函数

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

JavaScript boolean constructor()方法返回对创建原型的布尔函数的引用。

constructor - 语法

boolean.constructor()

constructor - 返回值

返回创建此对象的函数。

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

来源:LearnFk无涯教程网

constructor - 示例

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

运行上面代码输出

无涯教程网

bool.constructor() is : function Boolean() { [native code] }

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

技术教程推荐

React实战进阶45讲 -〔王沛〕

Linux性能优化实战 -〔倪朋飞〕

DDD实战课 -〔欧创新〕

安全攻防技能30讲 -〔何为舟〕

互联网人的英语私教课 -〔陈亦峰〕

To B市场品牌实战课 -〔曹林〕

说透数字化转型 -〔付晓岩〕

反爬虫兵法演绎20讲 -〔DS Hunter〕

React Native 新架构实战课 -〔蒋宏伟〕

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