- Javascript - Page Printing
- Javascript - Void Keyword
- Javascript - Dialog Boxes
- Javascript - Page Redirect
- Javascript - Cookies
- Javascript - Events
- Javascript - Functions
- Javascript - Loop Control
- Javascript - For...in
- Javascript - For Loop
- Javascript - While Loop
- Javascript - Switch Case
- Javascript - If...Else
- Javascript - Operators
- Javascript - Variables
- Javascript - Placement
- Javascript - Enabling
- Javascript - Syntax
- Javascript - Overview
- Javascript - Home
JavaScript Objects
- Javascript - HTML DOM
- Javascript - RegExp
- Javascript - Math
- Javascript - Date
- Javascript - Arrays
- Javascript - Strings
- Javascript - Boolean
- Javascript - Number
- Javascript - Objects
JavaScript Advanced
- Javascript - Browsers
- Javascript - Image Map
- Javascript - Debugging
- Javascript - Multimedia
- Javascript - Animation
- Javascript - Validations
- Javascript - Error Handling
JavaScript Useful Resources
- Javascript - Resources
- Javascript - Functions
- Javascript - Quick Guide
- Javascript - Questions And Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
JavaScript - The Boolean Object
The Boolean object represents two values, either "true" or "false". If value parameter is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (""), the object has an initial value of false.
Syntax
Use the following syntax to create a boolean object.
var val = new Boolean(value);
Boolean Properties
Here is a pst of the properties of Boolean object −
Sr.No. | Property & Description |
---|---|
1 | Returns a reference to the Boolean function that created the object. |
2 | The prototype property allows you to add properties and methods to an object. |
In the following sections, we will have a few examples to illustrate the properties of Boolean object.
Boolean Methods
Here is a pst of the methods of Boolean object and their description.
Sr.No. | Method & Description |
---|---|
1 | Returns a string containing the source of the Boolean object; you can use this string to create an equivalent object. |
2 | Returns a string of either "true" or "false" depending upon the value of the object. |
3 | Returns the primitive value of the Boolean object. |
In the following sections, we will have a few examples to demonstrate the usage of the Boolean methods.
Advertisements