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

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

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

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

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

How to create a Date object in JavaScript?

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

When an empty statement is encountered, a JavaScript interpreter

  

  

  

  

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.

  

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

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

  

  

  

  

var var1 = "Pritesh";

Above variable can store value of type.

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

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

  

  

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

  

  

  

  

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

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

  

  

  

Scripting language are

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

What is mean by "this" keyword in javascript?

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

JavaScript is interpreted by _________

  

  

  

  

"++" can operate only on ________________.

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

var num;

Above Statement is called as __________ Statement.

  

  

  

  

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

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

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

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

 

  

  

Which of the following is not a JSON type?

  

  

  

  

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

  

  

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

  

  

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

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

What will be the output of the following script ?

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

 

  

  

  

  

Integer Variable + Character Variable + Undefined Variable = ______________ Value

  

  

  

  

JSON name/value pair is written as

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

A ________ object is a reference to one of the classes in a Java package, such as netscape.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 navigator object properties is the same in both   Netscape and IE?

  

  

  

  

Adding String and Integer always results in _________.

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

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

  

  

  

  

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

  

  

  

Which best explains getSelection()?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

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

What is the output.?

  

  

  

  

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

  

  

  

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

  

  

"Add and Assignment" operator is shown by this symbol.

  

  

  

  

A hexadecimal literal begins with

  

  

  

  

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

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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

  

  

  

  

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

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

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 company developed JavaScript?

  

  

  

  

All modern browsers supports JS.

  

  

Which of the following is not JavaScript Data Types?

  

  

  

  

Which of the following is not considered as an error in JavaScript?

  

  

  

  

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

 

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

The escape sequence ‘f’ stands for

  

  

  

  

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

  

  

  

  

A statement block is a

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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?

  

  

  

  

The script tag must be placed in

  

  

  

  

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

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

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"

 

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

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

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

A conditional expression is also called a

  

  

  

  

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

  

  

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

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

  

  

  

  

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.