Java Script
Java Script
BSIT 1-B
JavaScript Exercise
Answer.:
Answer.
Let x = 100;
Answer.
Let x = 5;
Let y = 10;
Let sum = x + y;
Document.getElementById(“demo”).innerHTML = sum;
Create a variable called z, assign x+y to it, and display the result in an alert
box
Answer.
Let x = 5;
Let y = 10;
Let z = x + y;
Alert(z);
On one single name declare three variables in the following names and
values
Answer.
Answer: +
What would the value of the variable ‘answer’ be, after this code is run?
Answer: 3
What would the value of the variable ‘fullName’ be, after this code is run?
Answer: Stefan Jones
What would the value of the variable ‘x’ be, after this code is run?
Answer: Jane25
What would the value of the variable ‘age’ be, after you press the A button
two times?
Answer: 18
What would the value of the variable ‘age’ be, after you press the A button
once?
Answer: 11
Answer: No
Answer: Yes
Answer: Yes
What would be shown when this code is run?
Answer: Yes
Answer: 123123
Answer: =
<script>
Var x = 5;
</script>
Answer: False
Return type;
Answer: Short
Var a = “1”;
Var b = 5;
Answer: Text