Boolean Lesson 2
Booleans continued
Booleans are just true and false statements. If you put " 3 > 1", the output would be true, because 3 is more than 1 (wow so amazing).
### Booleans Example
Below is an example of what a boolean is. This is how they work
%%js
//You can use these to check your booleans
let keyInserted = true;
let correctKey = false;
let lockPick = true;
if (lockPick) {
console.log("Door opened.")
}
else {
//Check if the key you have was inserted and is the correct key
if (keyInserted){
console.log("Inserted key into door.")
}
else {
console.log("Insert key into door.")
}
if (keyInserted && correctKey){
console.log("Door opened.")
}
else {
console.log("Incorrect key.")
}
}