Last active
April 30, 2019 14:22
-
-
Save AlenaNik/8a369a794d2bc9fab434dd30195124a6 to your computer and use it in GitHub Desktop.
This file contains 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
// 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