📜  JavaScript 布尔构造函数属性

📅  最后修改于: 2022-05-13 01:56:41.084000             🧑  作者: Mango

JavaScript 布尔构造函数属性

下面是布尔构造函数属性的示例。

  • 例子:
javascript


html


 

    
        JavaScript Boolean constructor Property
    

 

 
    
                      

GeeksforGeeks

                           

            JavaScript Boolean constructor Property             returns the function that created             the boolean's prototype:         

                                           
                 


html


 

    
        JavaScript Boolean constructor Property
    

 

 
    
                      

GeeksforGeeks

                           

            JavaScript Boolean constructor Property             returns the function that created             the boolean's prototype:         

                   

      
                 


  • 输出:
bool.constructor:function Boolean() { [native code] }

在 JavaScript 中,布尔构造函数属性返回对象的构造函数。对于 JavaScript 布尔值,构造函数属性返回函数 Boolean() { [native code] }
句法:

boolean.constructor

返回值:返回函数Boolean() { [native code] }。
上述属性的更多示例代码如下:
示例 1:此示例说明布尔构造函数属性。

html



 

    
        JavaScript Boolean constructor Property
    

 

 
    
                      

GeeksforGeeks

                           

            JavaScript Boolean constructor Property             returns the function that created             the boolean's prototype:         

                                           
                                      

输出:

示例 2:此示例说明布尔构造函数属性。

html



 

    
        JavaScript Boolean constructor Property
    

 

 
    
                      

GeeksforGeeks

                           

            JavaScript Boolean constructor Property             returns the function that created             the boolean's prototype:         

                   

      
                          

输出:

支持的浏览器: JavaScript 布尔构造函数属性支持的浏览器列表如下:

  • 谷歌浏览器 1 及更高版本
  • Internet Explorer 3 及更高版本
  • Mozilla Firefox 1 及更高版本
  • Safari 1 及以上
  • Opera 4 及以上