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

switch(expression)
{
    statements
}

In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

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

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

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>
    <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 way can be used to indicate the LANGUAGE attribute?

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

JSON name/value pair is written as

  

  

  

  

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

  

  

  

  

A statement block is a

  

  

  

  

What does the tag do?

  

  

  

  

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

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

<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

  

  

  

  

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

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

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

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

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.

  

  

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

  

  

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

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

Java Statement terminated by ______________ ,

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

<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 is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

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

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

 

  

  

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

  

  

  

  

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

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

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?

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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

  

  

  

If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

  

  

  

  

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

  

  

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

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

Java Script Variable should be Case ___________.

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

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

  

  

  

  

The script tag must be placed in

  

  

  

  

Scripting language are

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Which of the following navigator object properties is the same in both   Netscape and IE?

  

  

  

  

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>

 

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

In the below notation, Employee is of type { “Employee”: [ “Amy”, “Bob”, “John” ] }

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

 

  

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

  

  

  

  

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

  

  

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

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

<script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script> 

What is the output?

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

  

  

  

  

"++" is __________ type of operator.

  

  

  

  

JavaScript is ideal to

  

  

  

  

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.