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
Infinite
B
Null
C
NaN
D
Zero
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 concatenated together.
B
values are added 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
Nothing will be printed
B
None of these
C
"Compile Error" will be printed
Question 5
var str = "Str";
var num = 10;

var output = str + num;
What will be the value of Variable 'output' ?
A
Nothing will be printed
B
Null
C
Str10
D
NaN
Question 5 Explanation: 
String + Number = String
There are 5 questions to complete.