Why JAVASCRIPT?
How to write and run Javascript
How to Add Javascript to Webpage
Representing data with values
Primitive Data Types
- Primitive Data Types
- Number Type
- String Type
- Boolean data type
- Undefined and null
- JavaScript Type Conversions
Operators
Expressions
Statements
- What are statements?
- Expression Statements
- Compound and Empty Statements
- Declaration Statements
- Conditional statements
- Loop statements
- Jump Statements
- Assignments
Arrays
Boolean variables store one of two possible values: either true or false. The term Boolean is named after George Boole (1815–1864), who created an algebraic system of logic. Because it’s named after a person, you generally write it with an initial capital letter. Boolean variables are often used for storing the results of comparisons. You can find out the Boolean value of a comparison or convert any value in JavaScript into a Boolean value by using the Boolean() function.
For example:
var isItGreater = Boolean (3 > 20);
console.log(isItGreater);
//false
var areTheySame = Boolean ("tiger" === "Tiger");
console.log(areTheySame);
//false
In JavaScript, the following values always evaluate to a Boolean false value:
• NaN
• undefined
• 0 (numeric value zero)
• -0
• “” (empty string)
• false