JavaScript MCQ : JS Statements (Multiple Choice Questions)
Question 1 |
Multiple JS statements are written inside pair of ________ to form a statement block.
Pair of Round Brackets | |
Pair of Curly braces | |
None of these | |
Pair of Square Brackets |
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 ?
Yes | |
No |
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.
Assignment Statement | |
Executable Statement | |
Declaration Statement | |
Conditional Statement | |
All Type of Statements are included inside JS Code |
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.
Will not print anything | |
"This is a heading" will be printed in H1 heading. | |
None of these | |
Just "This is a heading" will be printed because HTML tags are not allowed |
Question 4 Explanation:
JS is case sensitive. "W" should be in lower case.
Question 5 |
Group of JavaScript Statements is called as _________.
Statement Block | |
Cluster | |
Code Block | |
Group |
There are 5 questions to complete.