JavaScript MCQ : JS Variables (Multiple Choice Questions)


Question 1
Initialization of variable can be done by writing _____ operator in between variable name and operand value.
A
VALUE
B
EQUALS
C
==
D
=
Question 2
Multiple Declarations of variables are separated by ___________ symbol
A
Asterisk
B
Comma
C
Colon
D
Semicolon
Question 3
Underscore can be used as first letter while declaring variable in JavaScript .
A
True
B
False
Question 4
var var1 = "Pritesh";
Above variable can store value of type -
A
Any Type
B
String
C
Integer
D
None of these
Question 5
<!DOCTYPE html>
<html>
    <body>
        <script>
            var x = 5;
            var y = 6;
            var z = 5 + 6;
            document.write(x + "<br>");
            document.write(y + "<br>");
            document.write(z + "<br>");
        </script>
    </body>
</html>
Guess output of the following code.
A
5
6
10
B
5
6
11
C
Error
D
5
6
56
There are 5 questions to complete.