Go to page.A simple page.
Create a web-page that asks for a name and outputs it.
Go to page.fix the addition
Here’s a code that asks the user for two numbers and shows their sum.
let a = prompt("First number?", 1);
let b = prompt("Second number?", 2);
alert(a + b); // 12
It works incorrectly. The output in the example below is12
(for default prompt values).
Why? Fix it. The result should be3
.
Go to page.The name of JavaScript
Using the if..else construct, write the code which asks: ‘What is the “official” name of JavaScript?’