Javadeus Stardate 93715.9 Destination Variable

JavaScript is a very powerful scripting language. You can enter commands in a free compiler and learn how to code in JavaScript right in the console of Google Chrome browser.

var answer = prompt(‘What is the best programming language’);
if (answer===”JavaScript”) {
alert (“You are correct”)
}
else { alert(“JavaScript is the best language!”); }

Here we are storing a input prompt response in a variable called answer and setting a conditional statement to determine which output statement will be delivered by the program based on the input response.

Leave a Comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s