JavaScript MCQ : JS Statements (Multiple Choice Questions)


Question 1
Which of the following is not a compound assignment operator.
A
>>=
B
===
C
<<=
D
+=
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.
A
Null
B
Infinite
C
Zero
D
NaN
Question 2 Explanation: 
NaN stands for Not A Number.
Question 3
If the values on either side of '+' operator are numerical values then ___________.
A
values are added together
B
values are concatenated together.
C
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 ?
A
"Compile Error" will be printed
B
Nothing will be printed
C
None of these
Question 5
var str = "Str";
var num = 10;
var output = str + num;
What will be the value of Variable 'output' ?
A
NaN
B
Nothing will be printed
C
Null
D
Str10
Question 5 Explanation: 
String + Number = String
There are 5 questions to complete.