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

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

 

  

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

  

  

  

  

What are variables used for in JavaScript Programs?

  

  

  

  

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

  

  

  

  

How does JavaScript store dates in a date object? 

  

  

  

  

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

  

  

  

  

What will be printed inside webpage ?

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

 

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

var carname="Volvo"; 
var carname;

 

  

  

  

  

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

  

  

  

  

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

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

 

  

  

A conditional expression is also called a

  

  

  

  

Which of the following is not considered a JavaScript operator?

  

new

 

  

this

 

  

delete

 

  

typeof

 

Why so JavaScript and Java have similar name?

  

  

  

  

Group of JavaScript Statements is called as _________.

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

The type of a variable that is volatile is

  

  

  

  

Assignment Operators is following type of operator ______________.

  

  

  

  

JavaScript is _________ language.

  

  

  

  

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

Variable declared above is example of ___________ Variable.

  

  

Why JavaScript is called as Lightweight Programming Language ?

  

  

  

  

Choose the client-side JavaScript object?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

Comments in JS are ignored by ____________.

  

  

  

  

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

What will be the value of Variable 'output' ?

  

  

  

  

Local Variables are Destroyed as soon as ______________.

  

  

  

  

Which of the following is not a compound assignment operator.

  

  

  

  

Which was the first browser to support JavaScript ?

  

  

  

  

What does the tag do?

  

  

  

  

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

  

  

  

  

var num=20;

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

  

  

  

  

JavaScript is ______ Side Scripting Language.

  

  

  

  

<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

  

  

  

  

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

  

  

  

  

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

  

  

  

The syntax of Eval is ________________

  

  

  

  

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

  

  

  

  

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

  

  

  

  

JavaScript is a _______________ language

  

  

  

  

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

  

  

  

  

JavaScript is interpreted by _________

  

  

  

  

Which of the following attribute can hold the JavaScript version?

  

  

  

  

JavaScript is Case Sensitive !!Say True or False

  

  

Vriables declared inside function are visible _______________.

  

  

  

  

Which of the following is not an logical operator ?

  

  

  

  

Comment Statement is _________________ type of statement.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

A statement block is a

  

  

  

  

JavaScript Code can be called by using _________.

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

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

 

  

  

  

  

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"

 

What will be printed on the screen ? Var3 =100101010

  

  

  

  

Multiple Declarations of variables are separated by ___________ symbol

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

This code will include External JS inside your 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?

  

  

  

  

To open a dialog box each time an error occurs, which of the following is added to prefs.js?

  

  

  

  

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

  

  

  

  

The syntax of close method for document object is ______________

  

  

  

  

Java Script have following type of Comment(s) -

  

  

  

  

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

  

  

  

  

Executable single line of Script is called as _________________.

  

  

  

  

All modern browsers supports JS.

  

  

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

What is the output?

  

  

  

Consider the following statements

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

In the above code snippet, what happens?

  

  

  

  

It is not necessary to write Semicolon at the end of JS statement !!

  

  

Single Line Comment Starts with _________ Symbol.

  

  

  

  

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

  

  

  

  

Local Variables are destroyed after execution of function.

  

  

"++" is __________ type of operator.

  

  

  

  

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

  

  

  

  

JavaScript Code is written inside file having extension __________.

  

  

  

  

Conditional Operator shown in the following example is _____________.

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

 

  

  

  

  

Which types of image maps can be used with JavaScript?

  

  

  

  

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

  

  

  

  

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

  

  

  

  

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

  

  

  

  

The “var” and “function” are

  

  

  

  

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

  

  

  

  

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?

  

  

  

  

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

  

  

  

  

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

  

  

  

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

  

  

  

  

Which of the following is not a comparison operator ?

  

  

  

  

  

The script tag must be placed in

  

  

  

  

Which best explains getSelection()?

  

  

  

  

Microsoft Developed a compatible dialect of JavaScript called _____________.

  

  

  

  

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

  

  

  

  

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

 

  

  

  

  

The syntax of a blur method in a button object is ______________

  

  

  

  

JavaScript is also called as _____________.

  

  

  

  

Variable declared outside JavaScript Function is called as _______________ .

  

  

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.