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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

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

  

  

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

  

  

  

  

Which of the following is not considered as an error in JavaScript?

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

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

  

  

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?

  

  

  

  

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

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

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

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

The statement a===b refers to

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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

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

 

  

  

All modern browsers supports JS.

  

  

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

  

  

  

  

Which best explains getSelection()?

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

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

  

  

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

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

A conditional expression is also called a

  

  

  

  

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

  

  

JavaScript is _________ language.

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

The syntax of capture events method for document object is ______________

  

  

  

  

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

  

  

  

  

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

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

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.

  

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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

  

  

  

  

var num=20;

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

  

  

  

  

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

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

  

  

  

  

Is it necessary to use "var" keyword while declaring 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>

 

  

  

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

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

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

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

Scripting language are

  

  

  

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

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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

  

  

  

  

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

  

  

  

  

<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

  

  

  

  

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

  

  

  

  

The script tag must be placed in

  

  

  

  

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

What is the output?

  

  

  

  

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

What is the output.?

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

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

  

  

  

  

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

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

 

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

What is the output?

  

  

  

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.