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

Choose the server-side JavaScript object?

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

A statement block is a

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

<!DOCTYPE html>
<html>
    <body>
        <script>
            var x = 5;
            var y = 6;
            var z = 5 + 6;
            document.write(x + "<br>");
            document.write(y + "<br>");
            document.write(z + "<br>");
        </script>
    </body>
</html>

Guess output of the following code.

  

5
6
11



  

5
6
56

 

  

5
6
10

 

  

Java Script Variable should be Case ___________.

  

  

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

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

var num=20;

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

  

  

  

  

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

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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>

 

  

  

The type of a variable that is volatile is

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

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

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

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

  

  

  

  

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

  

  

Which of the following is not an logical operator ?

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

Which attribute is used to specifies that the script is executed when the page has finished parsing (only for external scripts)

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

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

  

  

  

  

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

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

  

  

  

  

What does the tag do?

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

"===" operator is _______________.

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

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

What is the output?

  

  

  

  

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

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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.

  

  

  

  

  

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

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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

 

  

  

  

  

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

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

 

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

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"

 

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

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

This code will include External JS inside your webpage.

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

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

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

 

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

  

  

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

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

 

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

<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 JavaScript variable cannot be used as First character but can be use after first character ?

  

  

  

  

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

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

All modern browsers supports JS.

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

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

  

  

  

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

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

  

  

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

What is the output.?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Which best explains getSelection()?

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

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

  

  

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.