JavaScript MCQ : JS Statements (Multiple Choice Questions)


Question 1
Multiple JS statements are written inside pair of ________ to form a statement block.
A
Pair of Round Brackets
B
Pair of Square Brackets
C
Pair of Curly braces
D
None of these
Question 2
<script type="text/javascript">
{
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
}
</script>
HTML Tags are allowed inside JS. Is this error free code ?
A
No
B
Yes
Question 3
Following JS Code Consists of different Type of Statements -
<script type="text/javascript">
    var i = 10;
    if (i < 10) {
        document.write("<h1>This is a heading</h1>");
        document.write("<p>This is a paragraph.</p>");
        document.write("<p>This is another paragraph.</p>");
    }
</script>
What are different Type of statements written inside above JS.
A
Declaration Statement
B
Executable Statement
C
All Type of Statements are included inside JS Code
D
Conditional Statement
E
Assignment Statement
Question 4
<script type="text/javascript">
    {
        document.Write("<h1>This is a heading</h1>");
    }
</script>
Above Code contain one executive Statement. Guess the Output of the Above Code.
A
Will not print anything
B
Just "This is a heading" will be printed because HTML tags are not allowed
C
"This is a heading" will be printed in H1 heading.
D
None of these
Question 4 Explanation: 
JS is case sensitive. "W" should be in lower case.
Question 5
Group of JavaScript Statements is called as _________.
A
Group
B
Code Block
C
Statement Block
D
Cluster
There are 5 questions to complete.