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

  

  

  

  

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

 

  

  

  

  

The statement a===b refers to

  

  

  

  

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

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

Which best explains getSelection()?

  

  

  

  

JavaScript contains a _________________ that assigns a value to a variable based on some condition.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

What does the tag do?

  

  

  

  

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

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The _______ method of an Array object adds and/or removes elements from an array.

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

Scripting language are

  

  

  

JavaScript is _________ language.

  

  

  

  

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

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

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

  

  

  

  

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

  

  

Which company developed JavaScript?

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

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

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

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

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

Java Script Variable should be Case ___________.

  

  

<script type="text/javascript">
var s = "9123456 or 80000?";
var pattern = /\d{4}/;
var output = s.match(pattern);
document.write(output);
</script>

What is the output?

  

  

  

  

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

 

  

____________ is used to assign value to the variable.

  

  

  

  

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.

  

  

  

  

  

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

  

  

  

  

"===" operator is _______________.

  

  

  

  

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

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

  

  

  

The “var” and “function” are

  

  

  

  

<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

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

JavaScript is interpreted by _________

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

The syntax of capture events method for document object 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>

 

  

  

  

  

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

  

  

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

What is the output.?

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

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

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

Comment Statement is _________________ type of 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?

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

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?

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

The generalised syntax for a real number representation is

  

  

  

  

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

  

  

Java Statement terminated by ______________ ,

  

  

  

  

All modern browsers supports JS.

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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

  

  

  

  

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.