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

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

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

  

  

  

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

Variable name contain following type of characters -1. Alphabet2. Digits3. Underscore4. Special ChractersSelect the correct option.

  

  

  

  

JavaScript is _________ language.

  

  

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

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

  

  

  

  

"+=" operator can operate on following data values.

  

  

  

  

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

  

  

  

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

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

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

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

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

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

 

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

The syntax of a blur method in a button object is ______________

  

  

  

  

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

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

____________ is used to assign value to the variable.

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

JavaScript is also called as _____________.

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

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

  

  

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

  

  

  

  

A statement block is a

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

What does the tag do?

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

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

  

  

What is the correct syntax for referring to an external script called " abc.js"?

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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?

  

  

  

  

A conditional expression is also called a

  

  

  

  

What type of value gets printed if we add following two variables.

var a = "1";
var b = 5;

 

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

Non Initialized Variable have value "undefine", What value be printed in following case.

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

The statement a===b refers to

  

  

  

  

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

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

 

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

The “var” and “function” are

  

  

  

  

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

  

  

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

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

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

  

  

  

  

Is this placement of JS code inside HTML Element is Error Free ?

<html><head><title>My Page</title>
</head>
<body>
<a href="javascript:myFunction();">Click here</a>
<script language="javascript" type="text/javascript">
function myFunction() {
    alert('Hello world');
}
</script>
</body>
</html>

 

  

  

Adding String and Integer always results in _________.

  

  

  

  

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

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

All modern browsers supports JS.

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

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

  

  

<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 of the following navigator object properties is the same in both   Netscape and IE?

  

  

  

  

<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

  

  

JS Comment can be used for following purposes

  

  

  

  

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

  

  

  

  

<script type="text/javascript">
// document.write("<h1>Heading</h1>");
document.write("<p>Google</p>");
document.write("<p>Yahoo</p>");
</script>

Which of the statement will be neglected by Browser ?

  

<p>Google</p>

 

  

<p>Yahoo</p>

 

  

<h1>Heading</h1>

 

  

Assignment Operators is following type of operator ______________.

  

  

  

  

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

What is the output.?

  

  

  

  

Scripting language are

  

  

  

To open a dialog box each time an error occurs, which of the following is added to prefs.js?

  

  

  

  

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

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

Which of the following is considered as End of Single line comment ?

  

  

  

  

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

  

  

  

  

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.