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

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

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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

  

  

  

  

Using _______ statement is how you test for a specific condition.

  

  

  

  

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

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

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

  

  

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

  

  

  

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

  

  

  

<script>
document.write(navigator.appCodeName);
</script>

What is the output?

  

  

  

JavaScript is a _______________ language

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

If the values on either side of '+' operator are numerical values then ___________.

  

  

  

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

  

  

  

  

var str = "Str";
var num = 10;
var output = str + num;

What will be the value of Variable 'output' ?

  

  

  

  

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

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

A conditional expression is also called a

  

  

  

  

A statement block is a

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

____________ is used to assign value to the variable.

  

  

  

  

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

  

  

Consider the following statements

var count = 0;
while (count < 10) 
{
     console.log(count);
     count++;
}

In the above code snippet, what happens?

  

  

  

  

The output for the following code snippet would most appropriately be

var a=5 , b=1
var obj = { a : 10 }
with(obj) 
{
      alert(b)
}

 

  

  

  

  

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

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

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

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

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 statement is used to declare variable in JavaScript ?

  

  

  

  

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.