Prompt types problem in JavaScript
Note that the prompt function always
returns a string, even if the user entered a
number. For example, consider the following script:
javascriptlet num1 = prompt('Enter the first number');
let num2 = prompt('Enter the second number');
alert(num1 + num2); // concatenates numbers like strings
Задание 1
Modify the above code so that numbers are summed not like strings.
Задание 2
Use the prompt function to ask
the user for the side of a square.
Display the area of the given square.
Задание 3
Use the two functions prompt
to ask the user for the sides of a
rectangle. Display the perimeter of
the given rectangle.