JavaScript MCQ : JS Statements (Multiple Choice Questions)
Question 1 |
Which of the following is not a compound assignment operator.
>>= | |
=== | |
<<= | |
+= |
Question 1 Explanation:
Compound assignment operators exist for each of the major mathematical operations
Question 2 |
If a string cannot be converted to a number __________ will be returned.
Null | |
Infinite | |
Zero | |
NaN |
Question 2 Explanation:
NaN stands for Not A Number.
Question 3 |
If the values on either side of '+' operator are numerical values then ___________.
values are added together | |
values are concatenated together. | |
None of These |
Question 4 |
<html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- var A = "Compile ", B = "Error"; C = A + B; alert(C); // --> </script> </head> <body></body> </html>What will be printed ?
"Compile Error" will be printed | |
Nothing will be printed | |
None of these |
Question 5 |
var str = "Str"; var num = 10; var output = str + num;What will be the value of Variable 'output' ?
NaN | |
Nothing will be printed | |
Null | |
Str10 |
Question 5 Explanation:
String + Number = String
There are 5 questions to complete.