Page 390 - Webapplication11_C11_Flipbook
P. 390
Unsolved Exercise
Section A
(Objective Type Questions)
A. Choose the correct option.
1. What will be the output of the following JavaScript code:
<script>
a=6;
if(a=== "6")
document.write("True");
else
document.write("False");
}
</script>
i. True ii. False
iii. Compiler Error iv. Run time Error
2. When we view a webpage containing JavaScript script, ................................ actually executes the script.
i. Web server ii. A machine on the internet
iii. Web browser iv. None of these
3. Variables in JavaScript are used to ................................ .
i. Store values ii. display values
iii. transfer values from keyboard to monitor iv. All of the above
4. As an alternative to an if...else statement, ................................ operator is commonly used.
i. Loop ii. Conditional operator
iii. if..else if…else statement iv. NaN
5. Which of the following is not a valid JavaScript variable name?
i. basicsal ii. basic_sal
iii. basicsal iv. 3basicsal
6. Which of the following is used to add single line comments in JavaScript?
i. : ii. //
iii. ; iv. " "
7. Which of the following is also the name of JavaScript?
i. ECMAScript ii. LiveScript
iii. Both i. and ii. iv. VBSCRIPT
8. Consider the following code:
var i = 10;
var j = 2;
while(i > j)
{
i = i / j;
document.write(i+" ");
}
What will be the final value of the variable i displayed?
i. 2.5 ii. 1.25
iii. 5 iv. 1
388 Touchpad Web Applications-XI

