JavaScript Reference/Javascript Objects/Boolean

Материал из Web эксперт
Перейти к: навигация, поиск

"Boolean" Example

    
<html>
<body>
<script language="javascript">
    function function1(){
        var bool = new Boolean(true); 
        alert(bool);
    }
</script>
<button onclick="function1();">True or false</button>
</body>
</html>



"Boolean" JavaScript Properties

+----------------+--------------------------------------------------------------+
| JavaScript     |constructor                                                   |
+----------------+--------------------------------------------------------------+



"Boolean" Syntax and Note

Note:
This object is equivalent to a Boolean type variable.
    
Syntax:
    
var booleanName = new Boolean(value) // value is true or false
booleanName.memberName