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
Semicolon
B
Colon
C
Comma
D
Asterisk
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
Integer
B
String
C
Any Type
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
56
B
5
6
11
C
5
6
10
D
Error
There are 5 questions to complete.