Skip to content

Instantly share code, notes, and snippets.

@AlenaNik
Last active April 30, 2019 14:22
Show Gist options
  • Save AlenaNik/8a369a794d2bc9fab434dd30195124a6 to your computer and use it in GitHub Desktop.
Save AlenaNik/8a369a794d2bc9fab434dd30195124a6 to your computer and use it in GitHub Desktop.
// try this on console
var result = window.prompt("Hey my friend, do you like potatoes?")
if (result == "Yes") {
for (var i = 0; i < 7; i++) {
var hash = "#";
console.log(hash.repeat([i]));}
}
else if (result == "No") {
window.alert("No potatoes for you.")
} else {
window.alert("I am not sure")
}
// just in case html page:
<html>
<head>
</head>
<body>
<h1>Hi</h1>
</body>
<script> var result = window.prompt("Hey my friend, do you like potatoes?")
if (result == "Yes") {
for (var i = 0; i < 7; i++)
var hash = "#";
console.log(hash.repeat([i]));
}
else if (result == "No") {
window.alert("No potatoes for you.")
} else {
window.alert("I am not sure")
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment