Created
June 8, 2022 01:38
-
-
Save natafaye/cd0624583b73c95d2c5b7f152bf77754 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
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