JavaScript MCQ : JS Operators (Multiple Choice Questions)


Question 1
Integer Variable + Character Variable + Undefined Variable = ______________ Value
A
Text / String Value
B
Character
C
Undefined Value
D
Integer
Question 2
Which of the following is not a comparison operator ?
A
++
B
==
C
>=
D
===
E
<=
Question 3
What will be the output of the following script ?
<!DOCTYPE html>
<html>
    
    <body>
        <script>
            var x = 5;
            document.write(x === "5");
        </script>
    </body>

</html>
A
5
B
true
C
false
D
1
Question 3 Explanation: 
Variable "x" is having integer value and we are using "===" operator. '===' operator will check the value and the type of value.
Question 4
What will be the output of the following script ?
<!DOCTYPE html>
<html>
    
    <body>
        <script>
            var x = 5;
            document.write(x == "5");
        </script>
    </body>

</html>
A
Undefined
B
5
C
false
D
true
Question 4 Explanation: 
"==" operator just checks the value.
Question 5
Adding String and Integer always results in _________.
A
None of these
B
Character
C
String
D
Integer
There are 5 questions to complete.