JavaScript中constructor()方法的使用简介


本文向大家介绍JavaScript中constructor()方法的使用简介,包括了JavaScript中constructor()方法的使用简介的使用技巧和注意事项,需要的朋友参考一下

 JavaScript Boolean.constructor()方法返回一个引用到创建实例的原型布尔函数。
语法

boolean.constructor()

返回值:

  •     NA

下面是参数的详细信息:

返回创建此对象的实例。
例子:

<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] }