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

The syntax of capture events method for document object is ______________

  

  

  

  

Which of the following event fires when the form element loses the focus: , , , , ?

  

  

  

  

JavaScript is _________ language.

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

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

  

  

  

  

Group of JavaScript Statements 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++;
}

 

  

  

  

  

"===" operator is _______________.

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

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

What is the output.?

  

  

  

  

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

  

  

  

  

Underscore can be used as first letter while declaring variable in JavaScript.

  

  

What does the tag do?

  

  

  

  

Which best explains getSelection()?

  

  

  

  

var num=20;

Above Statement is called as __________ Statement. Select all the appropriate options.

  

  

  

  

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

  

  

  

  

Which JavaScript variable cannot be used as First character but can be use after first character ?

  

  

  

  

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

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

In JavaScript, _________ is an object of the target language data type that encloses an object of the source language.

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

Is it necessary to use "var" keyword while declaring variable.

  

  

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

  

  

  

  

Which of the following operators not comes under assignment Operator ?Select all possible options.

  

  

  

  

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

  

  

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

All modern browsers supports JS.

  

  

In March 1996, _______________ was released, featuring support for JavaScript.

  

  

  

  

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

  

  

  

  

Scripting language are

  

  

  

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

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

<script type="text/javascript">
    var name;
    name = "Pritesh";
</script>
<script type="text/javascript">
    document.write(name);
</script>

What will be the output of the following ?

  

  

  

  

"async" attribute is used to include External JS Code Asynchronously.

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

 

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

Guess output of the following code.

  

5
6
11



  

5
6
56

 

  

5
6
10

 

  

Assignment Operators is following type of operator ______________.

  

  

  

  

JavaScript is ideal to

  

  

  

  

Which is the correct way to write a JavaScript array?

  

var txt = new Array(1:"tim",2:"kim",3:"jim")

 

  

var txt = new Array:1=("tim")2=("kim")3=("jim")

 

  

var txt = new Array("tim","kim","jim")

 

  

var txt = new Array="tim","kim","jim"

 

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

What will be the Output of the above Code ?

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Which of the following function of Array object returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found?

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

In JavaScript, Window.prompt() method return true or false value ?

  

  

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

  

  

  

Which tag(s) can handle mouse events in Netscape?

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

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

Guess output of the following code.

  

  

  

  

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

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

Which of the following way can be used to indicate the LANGUAGE attribute?

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

We cannot Place JS Code in the body tag . Say true/false.

  

  

Choose the client-side JavaScript object?

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

The “var” and “function” are

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

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

  

  

  

  

We can declare all type of variables in JavaScript with the keyword _____________.

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

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?

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

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

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

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

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

One of the special features of an interpreter in reference with the for loop is that ___________

  

  

  

  

A conditional expression is also called a

  

  

  

  

JSON name/value pair is written as

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

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.