Development - Java Script - Statements Test

Test Instructions :

1. The Test is 1hr duration.
2. The Test Paper consists of 30 questions. The maximum marks are 30.
3. All the questions are multiple choice question type with three options for each question.
4. Out of the three options given for each question, only one option is the correct answer.
5. Each question is allotted 1 mark for each correct response.
6. 0.25 will be deducted for incorrect response of each question.
Start Test

   Time Left : 00 : 30    : 00

Comments in JS are ignored by ____________.

  

  

  

  

-Infinity in JS gets added with -Infinity then output of the code will be.

  

  

  

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.

  

  

  

  

  

Consider the following statements

switch(expression)
{
    statements
}

In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?

  

  

  

  

It is not necessary to write Semicolon at the end of JS statement !!

  

  

The enumeration order becomes implementation dependent and non-interoperable if :

  

  

  

  

A conditional expression is also called a

  

  

  

  

<script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script> 

What is the output?

  

  

  

  

<html>
    <head>
        <title>A Simple Page</title>
        <script language="JavaScript">
            <!--
            var A = "Compile ",
                B = "Error";
            C = A + B;
            alert(C);
            //  -->
        </script>
    </head>
    <body></body>
</html>

What will be printed ?

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

What will be printed inside webpage ?

var message="Hello JS";
document.write(Message);

 

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

-Infinity in JS gets added with +Infinity then output of the code will be.

  

  

  

Person XYZ wrote his name and date of code creation at the start , What kind of comment he has written ?

  

  

  

  

Which is a more efficient code snippet ?

Code 1 :

for(var num=10;num>=1;num--)
{
           document.writeln(num);
}

Code 2 :

var num=10;
while(num>=1)
{
       document.writeln(num);
       num++;
}

 

  

  

  

  

Which of the following is the structure of an if statement?

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

Which of the following statement is used to declare variable in JavaScript ?

  

  

  

  

JavaScript Statement may contain HTML Tags. Say True/False.

  

  

<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 ?

  

  

<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.

  

  

  

  

If a string cannot be converted to a number __________ will be returned.

  

  

  

  

In multiple line comment , End of the comment is specified by ________ Symbol.

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

<script type="text/javascript">
var s = "9123456 or 80000?";
var pattern = /\d{4}/;
var output = s.match(pattern);
document.write(output);
</script>

What is the output?

  

  

  

  

During addition of two numbers , suppose one of the number is NaN then output of the following code will be ?

  

  

  

  

<script type="text/javascript">
x=4+"4";
document.write(x);
</script> 

What is the output.?

  

  

  

  

The “var” and “function” are

  

  

  

  

Note:
  • Click the 'Submit Test' button given in the bottom of this page to Submit your answers.
  • Test will be submitted automatically if the time expired.
  • Don't refresh the page.