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 is also called as _____________.

  

  

  

  

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

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

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

Variable declared above is example of ___________ Variable.

  

  

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

  

  

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

  

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

  

  

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

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

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

What is the output.?

  

  

  

  

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

  

  

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

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

The “var” and “function” are

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

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?

  

  

  

  

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

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

 

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

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 was the first browser to support JavaScript ?

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

What does the tag do?

  

  

  

  

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

  

  

  

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

  

  

  

  

What will be the output of the following script ?

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

</html>

 

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

Why so JavaScript and Java have similar name?

  

  

  

  

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

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

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

  

  

  

  

All modern browsers supports JS.

  

  

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

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

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

  

  

  

  

A statement block is a

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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"

 

Executable single line of Script is called as _________________.

  

  

  

  

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

  

  

  

  

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

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

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

 

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

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

var num;

 

  

  

  

undefined

 

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

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

What is the output?

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

  

  

  

  

Scripting language are

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

The script tag must be placed in

  

  

  

  

The output for the following code snippet would most appropriately be

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

 

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

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

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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.