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

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

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

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

What is the output.?

  

  

  

  

<script language="javascript">
function x()
{
document.write(2+5+"8");
}
</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 ?

  

  

  

  

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

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

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

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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.

  

  

  

  

  

JavaScript is Case Sensitive !!Say True or 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 ?

  

  

JavaScript is a _______________ language

  

  

  

  

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

  

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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++;
}

 

  

  

  

  

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

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

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

  

  

  

  

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.