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

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

What will be the value of Variable 'output' ?

  

  

  

  

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

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

JavaScript is ideal to

  

  

  

  

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

  

  

  

  

JavaScript entities start with _______ and end with _________.

  

  

  

  

A statement block is a

  

  

  

  

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

What will be the Output of the above Code ?

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

/* This is Simple Comment */

This is the example of ____________ Comment.

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

State the correct place of JS Code inside HTML -

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

What does the tag do?

  

  

  

  

Variable declared inside JavaScript Function will be called as ____________.

  

  

JSON strings have to be in

  

  

  

<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

  

  

  

  

JSON name/value pair is written as

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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.

  

  

  

  

Integer Variable is declared using following syntax in JavaScript.

  

Integer num;

 

  

var num;

 

  

int num;

 

  

integer num;

 

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

  

  

  

  

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

  

  

  

  

JavaScript is _________ language.

  

  

  

  

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

  

  

  

  

The statement a===b refers to

  

  

  

  

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

  

  

  

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

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

 

  

  

  

  

JS Comment can be used for following purposes

  

  

  

  

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

  

  

  

  

JavaScript Statements are executed by ________ .

  

  

  

  

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

  

  

  

  

The escape sequence ‘f’ stands for

  

  

  

  

JavaScript syntax to change the content of the following HTML code

  

  

  

  

To set up the window to capture all Click events, we use which of the following statement?

  

  

  

  

_________ is a wrapped Java array, accessed from within JavaScript code.

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Java Statement terminated by ______________ ,

  

  

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

The development environment offers which standard construct for data validation

  

  

  

  

Local Variables are Destroyed as soon 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 ?

  

  

  

  

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

  

  

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?

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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 syntax of Eval is ________________

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

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

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

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

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

<script language="javascript">
function x()
{
document.write(2+5+"8");
}
</script> 

What is the output?

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

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

  

  

  

  

The generalised syntax for a real number representation is

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

Which of the following is not a JSON type?

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

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

var num;

 

  

  

  

undefined

 

  

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

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

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

  

  

All modern browsers supports JS.

  

  

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

 

  

  

  

  

JavaScript is invented by ________.

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

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

This code will include External JS inside your webpage.

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The script tag must be placed in

  

  

  

  

The “var” and “function” are

  

  

  

  

Is it possible to nest functions in JavaScript?

  

  

A hexadecimal literal begins with

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

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.

  

  

  

  

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.