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.