# JavaScript Booleans
● Boolean Values
Very often, in programming, I need a date tpe that caon only have one of two values, like
- YES / NO
- ON / OFF
- TRUE / FALSE
For this, JSP has a Boolean data type. It can only take the values True or False
●The Boolean() Function
I use the Boolean() function to find out if an expression is true.
● Booleans Can be Objects
Normally JSP booleans are primitive values created from literals: var x = false
But booleans can also be defined as objects with the keyword new: var y = new Boolean(false)
No comments:
Post a Comment