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

  

  

  

  

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

  

  

  

  

Choose the server-side JavaScript object?

  

  

  

  

JSON strings have to be in

  

  

  

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

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

Which of the following is correct about features of JavaScript?

  

  

  

  

<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 of the following function of String object causes a string to be italic, as if it were in an tag?

  

  

  

  

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

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

JavaScript is designed for following purpose 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

 

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

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

JavaScript code contain sequence of ___________.

  

  

  

  

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

  

  

  

  

A conditional expression is also called a

  

  

  

  

Which types of image maps can be used with 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?

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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

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

 

  

  

  

  

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.

  

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

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

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

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

  

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

Variable can hold ________ value at a time

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

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

  

  

  

  

Which of the following is the correct syntax to display “Welcome” in an alert box using JavaScript?

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

Which of the following navigator object properties is the same in both   Netscape and IE?

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

Local Variables are destroyed after execution of function.

  

  

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

  

  

  

  

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

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

"++" can operate only on ________________.

  

  

  

  

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

  

  

  

  

If the values on either side of '+' operator are numerical values then ___________.

  

  

  

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

  

  

  

  

JavaScript is _________ language.

  

  

  

  

Which of the following is not a JSON type?

  

  

  

  

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

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

The statement a===b refers to

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

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

  

  

  

  

<script type="text/javascript">
    var name;
    name = "Pritesh";
</script>
<script type="text/javascript">
    document.write(name);
</script>

What will be the output of the following ?

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

Which company developed JavaScript?

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

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

 

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

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

  

  

  

  

Which best explains getSelection()?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Scripting language are

  

  

  

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>

 

  

  

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

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

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

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

"++" is __________ type of operator.

  

  

  

  

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

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

 

  

  

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.