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

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

  

  

  

  

What will be the output of the following script ?

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

</html>

 

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

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

  

  

  

  

Scripting language are

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

JavaScript code contain sequence 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>

 

  

Comments in JS are ignored by ____________.

  

  

  

  

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

  

  

____________ is used to assign value to the variable.

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

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

  

  

  

  

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

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

Which of the following function of String object returns a string representing the specified object?

  

  

  

  

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>

 

  

  

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

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

Which best explains getSelection()?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

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

  

  

  

  

_____ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation.

  

  

  

  

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

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

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

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

  

  

  

What does the tag do?

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

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

 

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

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"

 

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

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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

  

  

  

  

Which company developed JavaScript?

  

  

  

  

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

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

 

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

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

  

  

  

  

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

What is the output?

  

  

  

  

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

  

  

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?

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JSON name/value pair is written as

  

  

  

  

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

  

  

  

  

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 operators not comes under assignment Operator ?Select all possible options.

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

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.