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
var input = prompt("What is your name?", "Kilgore Trout"); | |
print("Well hello " + (input || "dear")); |
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
var answer = prompt("You! What is the value of 2 + 2?", ""); | |
if (answer == "4") | |
alert("You must be a genius or something."); | |
else if (answer == "3" || answer == "5") | |
alert("Almost!"); | |
else | |
alert("You're an embarrassment."); |
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
var answer = prompt("You! What is the value of 2 + 2?", ""); | |
if (answer == "4") | |
alert("You must be a genius or something."); | |
else if (answer == "3" || answer == "5") | |
alert("Almost!"); | |
else | |
alert("You're an embarrassment."); |
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
var input = prompt("What is your name?", "Kilgore Trout"); { | |
print("Well hello " + (input || "dear")); | |
if (input == "Shady") | |
print("Alright then."); | |
else | |
print("See you back at the mansion."); | |
} |
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
var result = 1; | |
var counter = 0; | |
while (counter < 10) { | |
result = result * 2; | |
counter = counter + 1; | |
} | |
show(result); |
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
for (var i = 0; i < 9; i++) { | |
n += i; | |
myfunc(n); | |
} |
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
var result = 1; | |
var counter = 0; | |
while (counter < 10) { | |
result = result * 2; | |
counter = counter + 1; | |
} | |
show(result); |
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
var line = ""; | |
var counter = 0; | |
while (counter < 10) { | |
line = line + #; | |
print(line); | |
counter = counter + 1; | |
} |
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
var line = ""; | |
var counter = 0; | |
while (counter < 10) { | |
line = line + #; | |
print(line); | |
counter = counter + 1; | |
} |
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
var result = 1; | |
var counter = 0; | |
while (counter < 10) { | |
result = result * 2; | |
counter = counter + 1; | |
} | |
show(result); |