Unit 5 - Exercise
Unit 5 - Exercise
A. 1. True
2. True
3. True
4. True
5. True
B. 1.
var str1 = 'click';
var str2 = 'start';
var result = str1 + str2;
console.log("Concatenated string: " + result);
2.
// Single-line comment: This line initializes a variable with a number
var number = 10;
/*
* Multi-line comment:
* The following code adds the number and outputs it.
* This is just for demonstration purposes.
*/
var result = number + 5;
3.
var length = 10;
var breadth = 5;
var height = 3;
var volume = length * breadth * height;
4.
window.confirm("Plant more trees.");
C.
2. window.prompt() asks the user to input text and returns the entered
value.