A boolean like a string or number is a data type in JavaScript. Strings are anything with single or double quotes around them.
"A string"
'Also a string'
1 //A number
true //A boolean
false //Another boolean
var hungry = true;
var full = false;
console.log(hungry);
console.log(full);
A boolean experession is something that results in true or false
if(5 > 4){
console.log("Yes");
} else {
console.log("NO");
}
if(10 > 11){
console.log("10 is greater than 11");
}else{
console.log("10 is not greater than 11")
}
> means greater than
< means less than
=== means equal to
So Does == But always use three equal signs
Write a function that takes in two numbers and prints out the larger number to the console.
JS Bin on jsbin.com
<= means less than or equal to
>= means greater than or equal to
!== means not equal to
Putting a ! in front of any means its opposite
&& means AND
|| means OR
if(!(5 > 4)){
console.log("Yes");
}else {
console.log("NO");
}
if( 5 > 4 && 6 > 5){
console.log("Both are true");
}else{
console.log("Both were not true");
}
if(5 > 4 || 3 > 4){
console.log("At least one was true");
}else{
console.log("None were true");
}
if( 5 !== 4){
console.log("That's right 5 is not equal to 4")
}else {
console.loge("5 is equal to 4")
}
| 100 - 90 | A |
| 89-80 | B |
| 79 - 70 | C |
| 69-60 | D |
| 60 or less | F |
Write a function called "pluralizer()" that: