Skip to content

Instantly share code, notes, and snippets.

@natafaye
Created June 8, 2022 01:38
Show Gist options
  • Save natafaye/cd0624583b73c95d2c5b7f152bf77754 to your computer and use it in GitHub Desktop.
Save natafaye/cd0624583b73c95d2c5b7f152bf77754 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>
let howManyCats = prompt("How many cats do you have?")
console.log(howManyCats);
if(howManyCats >= 3 && howManyCats <= 50) {
alert("We're best friends!")
}
else if(howManyCats > 50) {
alert("You have too many cats, get help!")
}
else {
alert("Go away!")
}
while(howManyCats <= 5) {
howManyCats++;
alert("Here's another cat!")
}
alert("Now you have the right amount of cats: " + howManyCats)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment