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

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

  

  

It is not necessary to write Semicolon at the end of JS 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?

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

"===" operator is _______________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

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

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

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

  

  

  

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

  

  

  

  

Which best explains getSelection()?

  

  

  

  

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

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

<script>
document.write(navigator.appCodeName);
</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

 

  

The statement a===b refers to

  

  

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

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

  

  

  

  

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

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript was originally developed under the name _______.

  

  

  

  

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

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

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

  

  

  

  

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

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

  

  

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

Variable declared above is example of ___________ Variable.

  

  

The syntax of capture events method for document object is ______________

  

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

JavaScript was invented at _______ Lab .

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

JSON strings have to be in

  

  

  

JavaScript is a _______________ language

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Scripting language are

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

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

  

  

  

  

<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 language="javascript">
function x()
{
document.write(2+5+"8");
}
</script> 

What is the output?

  

  

  

  

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

  

  

  

  

The “var” and “function” are

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

____________ is the tainted property of a window object.

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

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

  

  

  

Which of the following is correct about features of JavaScript?

  

  

  

  

JavaScript is _________ language.

  

  

  

  

All modern browsers supports JS.

  

  

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

  

  

  

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

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

<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 is not considered as an error in JavaScript?

  

  

  

  

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

  

  

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

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

JSON name/value pair is written as

  

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

var num=20;

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

  

  

  

  

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

  

  

  

  

If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?

  

  

  

  

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

  

  

  

  

"++" is __________ type of operator.

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

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

  

  

  

  

The script tag must be placed in

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

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

  

  

  

A conditional expression is also called a

  

  

  

  

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.