Skip to content

Instantly share code, notes, and snippets.

@natafaye
Created June 8, 2022 03:41
Show Gist options
  • Save natafaye/665bbd24809d29510a0a37bbde7bfe83 to your computer and use it in GitHub Desktop.
Save natafaye/665bbd24809d29510a0a37bbde7bfe83 to your computer and use it in GitHub Desktop.
<!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>
// 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