JavaScript MCQ : JS Operators (Multiple Choice Questions)
Question 1 |
Integer Variable + Character Variable + Undefined Variable = ______________ Value
Integer | |
Character | |
Text / String Value | |
Undefined Value |
Question 2 |
Which of the following is not a comparison operator ?
++ | |
<= | |
== | |
=== | |
>= |
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>
5 | |
false | |
true | |
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>
5 | |
Undefined | |
true | |
false |
Question 4 Explanation:
"==" operator just checks the value.
Question 5 |
Adding String and Integer always results in _________.
String | |
None of these | |
Integer | |
Character |
There are 5 questions to complete.