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

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

  

  

  

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

  

  

"++" can operate only on ________________.

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

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

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

Scripting language are

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

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

  

  

  

  

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

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

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

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

 

  

  

Adding String and Integer always results in _________.

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

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"

 

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>

 

  

  

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

  

  

  

  

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

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

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

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

"===" operator is _______________.

  

  

  

  

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

  

  

  

  

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

 

  

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

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

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

  

  

  

  

Is it possible to nest functions in JavaScript?

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

  

  

When a user views a page containing a JavaScript program, which machine actually executes the script?

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

What does the tag do?

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

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 can be called by using _________.

  

  

  

  

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

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

<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

  

  

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

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

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

What is the output?

  

  

  

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

  

  

  

  

Which of the following is not a JSON type?

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

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

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

Which company developed JavaScript?

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

All modern browsers supports JS.

  

  

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

Variable declared above is example of ___________ Variable.

  

  

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

  

  

  

  

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

  

  

  

  

Which of the following is the correct syntax to display “Welcome” in an alert box using JavaScript?

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

Which best explains getSelection()?

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

JSON name/value pair is written as

  

  

  

  

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.