Boolesche JavaScript -Referenz
JavaScript-Boolesche Werte
Boolesche JavaScript-Werte können einen von zwei Werten haben: true
oder
false
.
Die Boolean()-Funktion
Sie können die Boolean()
Funktion verwenden, um herauszufinden, ob ein Ausdruck wahr ist:
Beispiel
Boolean(10 > 9)
Oder noch einfacher:
Beispiel
(10 > 9)
10 > 9
Ein Tutorial zu Booleschen Werten finden Sie in unserem JavaScript Boolean Tutorial .
Boolesche JavaScript-Methoden
Method | Description |
---|---|
toString() | Converts a boolean value to a string, and returns the result |
valueOf() | Returns the primitive value of a boolean |
Boolesche JavaScript-Eigenschaften
Property | Description |
---|---|
constructor | Returns the function that created JavaScript's Boolean prototype |
prototype | Allows you to add properties and methods to the Boolean prototype |