Development - Java Script 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

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

To automatically open the console when a JavaScript error occurs which of the following is added to prefs.js?

  

  

  

  

Which of the following Attribute is used to include External JS code inside your HTML Document -

  

  

  

  

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

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

  

  

JS code included inside head section is loaded before loading page.

  

  

______method evaluates a string of JavaScript code in the context of the specified object.

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

What are variables used for in JavaScript Programs?

  

  

  

  

The main purpose of a “Live Wire” in NetScape is to

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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 event fires when the form element loses the focus: , , , , ?

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

A statement block is a

  

  

  

  

The statement a===b refers to

  

  

  

  

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

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

What is the correct JavaScript syntax to write "Hello World"?

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

Spaces,Punctuation marks are called as __________ Symbols in JavaScript.

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

A ________ object is a reference to one of the classes in a Java package, such as netscape.javascript .

  

  

  

  

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

  

  

  

JavaScript contains a _________________ that assigns a value to a variable based on some condition.

  

  

  

  

What will be the value of Variable - "num3" ?

var num1; 
var num2 = 10;
var num3 = num1 + num2;

 

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

<html>
    <body>
        <script>
            var name = "John Doe";
            var name = 123;
            document.write(name + "<br>");
        </script>
    </body>
</html>

Is it possible to change the type of value after re-assignment.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

<html>
<body>
<script type="text/javascript">
<!--
document.print("Hello");
//-->
</script>
</body>
</html>

What will be the Output of the above Code ?

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

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

  

  

  

  

JavaScript is ideal to

  

  

  

  

<script src="../main.js"></script>

This code will include External JS inside your webpage.

  

  

____________ is used to assign value to the variable.

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

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

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Which of the following function of Array object applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value?

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

Initialization of variable can be done by writing _____ operator in between variable name and operand value.

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

When you assign a text value to a variable, we put text value in the pair of _________.

  

  

  

JavaScript is also called as _____________.

  

  

  

  

_______ class provides an interface for invoking JavaScript methods and examining JavaScript properties.

  

  

  

  

"===" operator is _______________.

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

When there is an indefinite or an infinity value during an arithmetic value computation, javascript

  

  

  

  

function message() {
    var name = "Pritesh";
    alert(name);
}

Variable declared above is example of ___________ Variable.

  

  

What does the tag do?

  

  

  

  

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

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

<!DOCTYPE html>
<html>
    <body>
        <script>
            var num1 = 1;
            var num2 = 1;
            var num3 = "1" + num1 + num2;
            document.write(num1 + "<br>");
            document.write(num2 + "<br>");
            document.write(num3 + "<br>");
        </script>
    </body>
</html>

Guess output of the following code.

  

  

  

  

<html>
    <body>
        <script>
            var x = 5;
            var y = 6;
            document.write((x + y) + "<br>");
        </script>
    </body>
</html>

What will be the output of the following code ?

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

Is this correct syntax to include JS Code inside HTML Page ?

<script type="text/javascript">
...
</script>

 

  

  

All modern browsers supports JS.

  

  

When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type ___________

  

  

  

  

What will be the output of the following script ?

<!DOCTYPE html>
<html>
    <body>
        <script>
            var x = 5;
            document.write(x === "5");
        </script>
    </body>
</html>

 

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

To set up the window to capture all Click events, we use which of the following statement?

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

The _______ method of an Array object adds and/or removes elements from an array.

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

A conditional expression is also called a

  

  

  

  

Variable declared without a value will have the value ______________.Eg.

var num;

 

  

  

  

undefined

 

  

_________ is a wrapped Java array, accessed from within JavaScript code.

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

Guess the ternary operator used in the following example !!!

marks = (mark<35)?"Fail":"Pass";

 

  

  

  

  

To enable data tainting, the end user sets the _________ environment variable.

  

  

  

  

<html>
    <body>
        <script>
            var x = 12.45;
            var y = 1;
            var z = '8' + x + y;
            document.write(z + "<br>");
        </script>
    </body>
</html>

Value of Z is

  

  

  

  

It is good to include JS code inside footer section in order to speed up the Page loading time of Webpage.

  

  

Multiple JS statements are written inside pair of ________ to form a statement block.

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

"++" is __________ type of operator.

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

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

  

  

JavaScript Code can be called by using _________.

  

  

  

  

Which of the following operator is used to concatenate two strings.

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

Which of the following function of String object causes a string to be italic, as if it were in an tag?

  

  

  

  

The JavaScript exception is available to the Java code as an instance of __________

  

  

  

  

"Add and Assignment" operator is shown by this symbol.

  

  

  

  

We can declare ___________ at a time. Select most appropriate option.

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

______ attribute is used to specify the character encoding used in an external script file.

  

  

  

  

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.