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 is not a compound assignment operator.

  

  

  

  

All modern browsers supports JS.

  

  

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

  

  

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?

  

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

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

  

  

  

  

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

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

"++" is __________ type of operator.

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

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

  

  

  

  

Which company developed JavaScript?

  

  

  

  

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

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

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

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

What does the tag do?

  

  

  

  

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

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

A conditional expression is also called a

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The syntax of Eval is ________________

  

  

  

  

Which best explains getSelection()?

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

JavaScript is ideal to

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

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

  

  

  

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

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The “var” and “function” are

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Is this correct syntax to include JS Code inside HTML Page ?

<script type="text/javascript">
...
</script>

 

  

  

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

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

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

  

  

  

  

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

  

  

  

  

"===" operator is _______________.

  

  

  

  

JSON name/value pair is written as

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

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

  

  

  

  

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?

  

  

  

  

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

 

  

var num=20;

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

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

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

  

  

  

  

____________ is used to assign value to the variable.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

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

 

  

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

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

  

  

  

  

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

  

  

Executable single line of Script is called as _________________.

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

Adding String and Integer always results in _________.

  

  

  

  

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

  

  

  

  

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

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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 navigator object properties is the same in both   Netscape and IE?

  

  

  

  

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

  

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

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

  

  

  

  

The script tag must be placed in

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

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.