Created
June 8, 2022 03:41
-
-
Save natafaye/665bbd24809d29510a0a37bbde7bfe83 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script src="week2.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Should not get invited | |
// let likesCheese = false; | |
// let hasJob = false; | |
// Should not get invited | |
// let likesCheese = true; | |
// let hasJob = true; | |
// Should not get invited | |
let likesCheese = false; | |
let hasJob = true; | |
// This one should get invited | |
// let likesCheese = true; | |
// let hasJob = false; | |
if(!hasJob && likesCheese) { | |
alert("Come work this job in my cheese factory!") | |
} | |
let numCats = prompt("How many cats do you have?"); | |
// check it at 0, 1, 4, 5, 6, 20 | |
if(numCats >= 20) { | |
alert("We're stealing some cats") | |
} | |
if(numCats >= 5) { | |
alert("We're friends!"); | |
} | |
else { | |
alert("Go away!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment